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 2022-09-01 09:33:59 -07:00 committed by GitHub
parent c9b0930e79
commit cd49101fc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 18 deletions

View File

@ -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
}

View File

@ -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 == "" {

View File

@ -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,

View File

@ -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") {