Skip to content

Commit b718705

Browse files
committed
Fix authorization-config/authentication-config handling
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
1 parent effe6ce commit b718705

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

pkg/daemons/control/server.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,15 @@ func apiServer(ctx context.Context, cfg *config.Control) error {
211211
argsMap["cert-dir"] = certDir
212212
argsMap["allow-privileged"] = "true"
213213
argsMap["enable-bootstrap-token-auth"] = "true"
214-
if authConfigFile := util.ArgValue("authorization-config", cfg.ExtraAPIArgs); authConfigFile == "" {
215-
logrus.Warn("Not setting kube-apiserver 'authorization-mode' and 'anonymous-auth' flags due to user-provided 'authorization-config' file.")
214+
if util.ArgValue("authorization-config", cfg.ExtraAPIArgs) == "" {
216215
argsMap["authorization-mode"] = strings.Join([]string{modes.ModeNode, modes.ModeRBAC}, ",")
216+
} else {
217+
logrus.Warn("Not setting kube-apiserver 'authorization-mode' flag due to user-provided 'authorization-config' file.")
218+
}
219+
if util.ArgValue("authentication-config", cfg.ExtraAPIArgs) == "" {
217220
argsMap["anonymous-auth"] = "false"
221+
} else {
222+
logrus.Warn("Not setting kube-apiserver 'anonymous-auth' flag due to user-provided 'authentication-config' file.")
218223
}
219224
argsMap["service-account-signing-key-file"] = runtime.ServiceCurrentKey
220225
argsMap["service-cluster-ip-range"] = util.JoinIPNets(cfg.ServiceIPRanges)

0 commit comments

Comments
 (0)