Unverified Commit 0809187c authored by Vitor Savian's avatar Vitor Savian Committed by GitHub

Adding cli to custom klipper helm image (#7682)

Adding cli to custom klipper helm image Signed-off-by: 's avatarVitor Savian <vitor.savian@suse.com>
parent c7dec8ed
...@@ -45,6 +45,7 @@ type Server struct { ...@@ -45,6 +45,7 @@ type Server struct {
DisableAgent bool DisableAgent bool
KubeConfigOutput string KubeConfigOutput string
KubeConfigMode string KubeConfigMode string
HelmJobImage string
TLSSan cli.StringSlice TLSSan cli.StringSlice
BindAddress string BindAddress string
EnablePProf bool EnablePProf bool
...@@ -252,6 +253,11 @@ var ServerFlags = []cli.Flag{ ...@@ -252,6 +253,11 @@ var ServerFlags = []cli.Flag{
Destination: &ServerConfig.KubeConfigMode, Destination: &ServerConfig.KubeConfigMode,
EnvVar: version.ProgramUpper + "_KUBECONFIG_MODE", EnvVar: version.ProgramUpper + "_KUBECONFIG_MODE",
}, },
&cli.StringFlag{
Name: "helm-job-image",
Usage: "(helm) Default image to use for helm jobs",
Destination: &ServerConfig.HelmJobImage,
},
ServerToken, ServerToken,
&cli.StringFlag{ &cli.StringFlag{
Name: "token-file", Name: "token-file",
......
...@@ -128,6 +128,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont ...@@ -128,6 +128,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
serverConfig.ControlConfig.DataDir = cfg.DataDir serverConfig.ControlConfig.DataDir = cfg.DataDir
serverConfig.ControlConfig.KubeConfigOutput = cfg.KubeConfigOutput serverConfig.ControlConfig.KubeConfigOutput = cfg.KubeConfigOutput
serverConfig.ControlConfig.KubeConfigMode = cfg.KubeConfigMode serverConfig.ControlConfig.KubeConfigMode = cfg.KubeConfigMode
serverConfig.ControlConfig.HelmJobImage = cfg.HelmJobImage
serverConfig.ControlConfig.Rootless = cfg.Rootless serverConfig.ControlConfig.Rootless = cfg.Rootless
serverConfig.ControlConfig.ServiceLBNamespace = cfg.ServiceLBNamespace serverConfig.ControlConfig.ServiceLBNamespace = cfg.ServiceLBNamespace
serverConfig.ControlConfig.SANs = util.SplitStringSlice(cfg.TLSSan) serverConfig.ControlConfig.SANs = util.SplitStringSlice(cfg.TLSSan)
......
...@@ -167,6 +167,7 @@ type Control struct { ...@@ -167,6 +167,7 @@ type Control struct {
ServiceNodePortRange *utilnet.PortRange ServiceNodePortRange *utilnet.PortRange
KubeConfigOutput string KubeConfigOutput string
KubeConfigMode string KubeConfigMode string
HelmJobImage string
DataDir string DataDir string
Datastore endpoint.Config `json:"-"` Datastore endpoint.Config `json:"-"`
Disables map[string]bool Disables map[string]bool
......
...@@ -207,7 +207,9 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error { ...@@ -207,7 +207,9 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
} }
// apply SystemDefaultRegistry setting to Helm before starting controllers // 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 helmchart.DefaultJobImage = config.ControlConfig.SystemDefaultRegistry + "/" + helmchart.DefaultJobImage
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment