Skip to content

Commit

Permalink
Adding cli to custom klipper helm image (#7682)
Browse files Browse the repository at this point in the history
Adding cli to custom klipper helm image

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
(cherry picked from commit 0809187)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
vitorsavian authored and brandond committed Jul 7, 2023
1 parent 49b549e commit e200425
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pkg/cli/cmds/server.go
Expand Up @@ -45,6 +45,7 @@ type Server struct {
DisableAgent bool
KubeConfigOutput string
KubeConfigMode string
HelmJobImage string
TLSSan cli.StringSlice
BindAddress string
EnablePProf bool
Expand Down Expand Up @@ -252,6 +253,11 @@ var ServerFlags = []cli.Flag{
Destination: &ServerConfig.KubeConfigMode,
EnvVar: version.ProgramUpper + "_KUBECONFIG_MODE",
},
&cli.StringFlag{
Name: "helm-job-image",
Usage: "(helm) Default image to use for helm jobs",
Destination: &ServerConfig.HelmJobImage,
},
ServerToken,
&cli.StringFlag{
Name: "token-file",
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/server/server.go
Expand Up @@ -128,6 +128,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
serverConfig.ControlConfig.DataDir = cfg.DataDir
serverConfig.ControlConfig.KubeConfigOutput = cfg.KubeConfigOutput
serverConfig.ControlConfig.KubeConfigMode = cfg.KubeConfigMode
serverConfig.ControlConfig.HelmJobImage = cfg.HelmJobImage
serverConfig.ControlConfig.Rootless = cfg.Rootless
serverConfig.ControlConfig.ServiceLBNamespace = cfg.ServiceLBNamespace
serverConfig.ControlConfig.SANs = util.SplitStringSlice(cfg.TLSSan)
Expand Down
1 change: 1 addition & 0 deletions pkg/daemons/config/types.go
Expand Up @@ -168,6 +168,7 @@ type Control struct {
ServiceNodePortRange *utilnet.PortRange
KubeConfigOutput string
KubeConfigMode string
HelmJobImage string
DataDir string
Datastore endpoint.Config `json:"-"`
Disables map[string]bool
Expand Down
4 changes: 3 additions & 1 deletion pkg/server/server.go
Expand Up @@ -208,7 +208,9 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
}

// apply SystemDefaultRegistry setting to Helm before starting controllers
if config.ControlConfig.SystemDefaultRegistry != "" {
if config.ControlConfig.HelmJobImage != "" {
helmchart.DefaultJobImage = config.ControlConfig.HelmJobImage
} else if config.ControlConfig.SystemDefaultRegistry != "" {
helmchart.DefaultJobImage = config.ControlConfig.SystemDefaultRegistry + "/" + helmchart.DefaultJobImage
}

Expand Down

0 comments on commit e200425

Please sign in to comment.