Browse Source

Convert deprecated flags to fatal errors for v1.25 (#6069)

* Replace warning with fatal errors.
* Group system-default-registry under (agent/runtime)

Signed-off-by: Derek Nola <derek.nola@suse.com>
pull/6090/head
Derek Nola 2 years ago committed by GitHub
parent
commit
cd49101fc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      pkg/agent/config/config.go
  2. 3
      pkg/cli/agent/agent.go
  3. 12
      pkg/cli/cmds/server.go
  4. 11
      pkg/cli/server/server.go

3
pkg/agent/config/config.go

@ -515,8 +515,7 @@ func get(ctx context.Context, envInfo *cmds.Agent, proxy proxy.Proxy) (*config.N
if nodeConfig.FlannelBackend == config.FlannelBackendNone {
nodeConfig.NoFlannel = true
} else if envInfo.NoFlannel {
logrus.Warn("no-flannel is deprecated, it will be removed in v1.25. Use --flannel-backend=none instead.")
nodeConfig.NoFlannel = envInfo.NoFlannel
logrus.Fatal("no-flannel is deprecated. Use --flannel-backend=none instead.")
} else {
nodeConfig.NoFlannel = envInfo.NoFlannel
}

3
pkg/cli/agent/agent.go

@ -46,8 +46,7 @@ func Run(ctx *cli.Context) error {
}
if cmds.AgentConfig.Token == "" && cmds.AgentConfig.ClusterSecret != "" {
logrus.Warn("cluster-secret is deprecated, it will be removed in v1.25. Use --token instead.")
cmds.AgentConfig.Token = cmds.AgentConfig.ClusterSecret
logrus.Fatal("cluster-secret is deprecated. Use --token instead.")
}
if cmds.AgentConfig.Token == "" {

12
pkg/cli/cmds/server.go

@ -476,6 +476,12 @@ var ServerFlags = []cli.Flag{
PauseImageFlag,
SnapshotterFlag,
PrivateRegistryFlag,
cli.StringFlag{
Name: "system-default-registry",
Usage: "(agent/runtime) Private registry to be used for all system images",
EnvVar: version.ProgramUpper + "_SYSTEM_DEFAULT_REGISTRY",
Destination: &ServerConfig.SystemDefaultRegistry,
},
AirgapExtraRegistryFlag,
NodeIPFlag,
NodeExternalIPFlag,
@ -501,12 +507,6 @@ var ServerFlags = []cli.Flag{
Usage: "(experimental) Enable Secret encryption at rest",
Destination: &ServerConfig.EncryptSecrets,
},
cli.StringFlag{
Name: "system-default-registry",
Usage: "(image) Private registry to be used for all system images",
EnvVar: version.ProgramUpper + "_SYSTEM_DEFAULT_REGISTRY",
Destination: &ServerConfig.SystemDefaultRegistry,
},
&SELinuxFlag,
LBServerPortFlag,

11
pkg/cli/server/server.go

@ -88,8 +88,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
}
if cfg.Token == "" && cfg.ClusterSecret != "" {
logrus.Warn("cluster-secret is deprecated, it will be removed in v1.25. Use --token instead.")
cfg.Token = cfg.ClusterSecret
logrus.Fatal("cluster-secret is deprecated. Use --token instead.")
}
agentReady := make(chan struct{})
@ -348,12 +347,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
}
serverConfig.ControlConfig.Skips = map[string]bool{}
for _, noDeploy := range app.StringSlice("no-deploy") {
logrus.Warn("no-deploy flag is deprecated, it will be removed in v1.25. Use --skip-deploy instead.")
for _, v := range strings.Split(noDeploy, ",") {
v = strings.TrimSpace(v)
serverConfig.ControlConfig.Skips[v] = true
}
if noDeploy := app.StringSlice("no-deploy"); len(noDeploy) > 0 {
logrus.Fatal("no-deploy flag is deprecated. Use --skip-deploy instead.")
}
serverConfig.ControlConfig.Disables = map[string]bool{}
for _, disable := range app.StringSlice("disable") {

Loading…
Cancel
Save