Skip to content

Commit 4f0f6b6

Browse files
committed
fix(apps/kubernetes): extend --oidc-* guard to catch --authentication-config too
Same class of upgrade regression: a customer who wired their own structured AuthenticationConfiguration by hand via `controlPlane.apiServer.extraArgs: [--authentication-config=...]` would hit a duplicate-flag scenario the moment they toggle `spec.oidc.mode` — kube-apiserver would receive two conflicting --authentication-config= arguments and the last-wins behaviour is undefined between apiserver versions. Add a second render-time guard that fails when a legacy --authentication-config= is present in the user-supplied extraArgs AND spec.oidc.mode is not None, pointing at the CustomConfig migration path (customConfig.config or customConfig.secretRef.name). Signed-off-by: Ivan Okhotnikov <[email protected]>
1 parent 00e7378 commit 4f0f6b6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎packages/apps/kubernetes/templates/cluster.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ metadata:
324324
{{- if hasPrefix "--oidc-" $arg }}
325325
{{- fail (printf "controlPlane.apiServer.extraArgs contains %q while spec.oidc.mode is %q — the kube-apiserver refuses to boot with both --authentication-config (injected by spec.oidc) and legacy --oidc-* flags. Remove the --oidc-* flags from controlPlane.apiServer.extraArgs and use spec.oidc.mode: CustomConfig with a customConfig.config carrying the same issuer/audience if you need to override, or spec.oidc.mode: System for the platform cozy default." $arg $.Values.oidc.mode) }}
326326
{{- end }}
327+
{{- if hasPrefix "--authentication-config" $arg }}
328+
{{- fail (printf "controlPlane.apiServer.extraArgs contains %q while spec.oidc.mode is %q — the chart already injects --authentication-config= for OIDC. Drop your explicit flag and let spec.oidc.mode: CustomConfig own the AuthenticationConfiguration (customConfig.config or customConfig.secretRef.name), or leave spec.oidc.mode: None and keep managing the flag yourself." $arg $.Values.oidc.mode) }}
329+
{{- end }}
327330
{{- end }}
328331
{{- end }}
329332
spec:

0 commit comments

Comments
 (0)