Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding configurations for charts #451

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 40 additions & 16 deletions cmd/release/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ type RKE2 struct {
Versions []string `json:"versions"`
}

// ChartsRelease
type ChartsRelease struct {
Workspace string `json:"workspace"`
ChartsRepoURL string `json:"charts_repo_url"`
ChartsForkURL string `json:"charts_fork_url"`
DevBranch string `json:"dev_branch"`
ReleaseBranch string `json:"release_branch"`
}

// User
type User struct {
Email string `json:"email"`
Expand Down Expand Up @@ -85,11 +94,12 @@ type Auth struct {

// Config
type Config struct {
User *User `json:"user"`
K3s *K3s `json:"k3s"`
Rancher *Rancher `json:"rancher"`
RKE2 *RKE2 `json:"rke2"`
Auth *Auth `json:"auth"`
User *User `json:"user"`
K3s *K3s `json:"k3s"`
Rancher *Rancher `json:"rancher"`
RKE2 *RKE2 `json:"rke2"`
Charts *ChartsRelease `json:"charts"`
Auth *Auth `json:"auth"`
}

func DefaultConfigPath() (string, error) {
Expand Down Expand Up @@ -212,6 +222,13 @@ func exampleConfig() Config {
},
},
},
Charts: &ChartsRelease{
Workspace: filepath.Join(gopath, "src", "github.com", "rancher", "charts"),
ChartsRepoURL: "https://github.com/rancher/charts",
ChartsForkURL: "",
DevBranch: "dev-v2.9",
ReleaseBranch: "release-v2.9",
},
Auth: &Auth{
Drone: &Drone{
K3sPR: "YOUR_TOKEN",
Expand Down Expand Up @@ -242,17 +259,17 @@ User

K3s {{ range $k3sVersion, $k3sValue := .K3s.Versions }}
{{ $k3sVersion }}:
Old K8s Version: {{ $k3sValue.OldK8sVersion}}
New K8s Version: {{ $k3sValue.NewK8sVersion}}
Old K8s Client: {{ $k3sValue.OldK8sClient}}
New K8s Client: {{ $k3sValue.NewK8sClient}}
Old Suffix: {{ $k3sValue.OldSuffix}}
New Suffix: {{ $k3sValue.NewSuffix}}
Release Branch: {{ $k3sValue.ReleaseBranch}}
Dry Run: {{ $k3sValue.DryRun}}
K3s Repo Owner: {{ $k3sValue.K3sRepoOwner}}
K8s Rancher URL: {{ $k3sValue.K8sRancherURL}}
Workspace: {{ $k3sValue.Workspace}}
Old K8s Version: {{ $k3sValue.OldK8sVersion}}
New K8s Version: {{ $k3sValue.NewK8sVersion}}
Old K8s Client: {{ $k3sValue.OldK8sClient}}
New K8s Client: {{ $k3sValue.NewK8sClient}}
Old Suffix: {{ $k3sValue.OldSuffix}}
New Suffix: {{ $k3sValue.NewSuffix}}
Release Branch: {{ $k3sValue.ReleaseBranch}}
Dry Run: {{ $k3sValue.DryRun}}
K3s Repo Owner: {{ $k3sValue.K3sRepoOwner}}
K8s Rancher URL: {{ $k3sValue.K8sRancherURL}}
Workspace: {{ $k3sValue.Workspace}}
K3s Upstream URL: {{ $k3sValue.K3sUpstreamURL}}{{ end }}

Rancher {{ range $rancherVersion, $rancherValue := .Rancher.Versions }}
Expand All @@ -265,4 +282,11 @@ Rancher {{ range $rancherVersion, $rancherValue := .Rancher.Versions }}

RKE2{{ range .RKE2.Versions }}
{{ . }}{{ end}}

Charts
Workspace: {{.Charts.Workspace}}
ChartsRepoURL: {{.Charts.ChartsRepoURL}}
ChartsForkURL: {{.Charts.ChartsForkURL}}
DevBranch: {{.Charts.DevBranch}}
ReleaseBranch: {{.Charts.ReleaseBranch}}
`
Loading