From 4fe45eba3255359e08f0b2a3394e4e40550477cb Mon Sep 17 00:00:00 2001 From: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> Date: Mon, 14 Sep 2026 01:04:12 -0700 Subject: [PATCH] fix(kubernetes): fail the OIDC bootstrap Job when the tenant CA is missing In mode=System the post-install hook Job patches the chart-owned -oidc-kubeconfig Secret with a real kubeconfig built from the tenant admin kubeconfig's CA data. When that CA data was empty the script only warned and exited 0, so the hook was satisfied, the HelmRelease reported Ready, and the Secret kept the install-time placeholder kubeconfig, which cannot authenticate. The failure only showed up when a user tried to use the downloaded kubeconfig. Exit 1 instead, so the install fails visibly and is retried. The Job already has backoffLimit: 6 and restartPolicy: OnFailure, and a failed ClusterRoleBinding apply in the same script already fails the Job the same way. Assisted-by: LLM Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> --- .../kubernetes/templates/oidc-rbac-job.yaml | 24 +++++++++---------- packages/apps/kubernetes/tests/oidc_test.yaml | 23 ++++++++++++++++++ 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/packages/apps/kubernetes/templates/oidc-rbac-job.yaml b/packages/apps/kubernetes/templates/oidc-rbac-job.yaml index 2b478dbaf..64b6792ce 100644 --- a/packages/apps/kubernetes/templates/oidc-rbac-job.yaml +++ b/packages/apps/kubernetes/templates/oidc-rbac-job.yaml @@ -300,10 +300,11 @@ spec: CA_DATA=$(kubectl --kubeconfig "$KUBECONFIG_TENANT" config view --raw \ --output=jsonpath='{.clusters[0].cluster.certificate-authority-data}') if [ -z "$CA_DATA" ]; then - echo "WARNING: tenant admin kubeconfig has no certificate-authority-data; leaving OIDC kubeconfig Secret as the install-time placeholder" >&2 - else - KUBECONFIG_FILE=$(mktemp) - cat > "$KUBECONFIG_FILE" <&2 + exit 1 + fi + KUBECONFIG_FILE=$(mktemp) + cat > "$KUBECONFIG_FILE" <&2\n\s+exit 1\n\s+fi' + documentIndex: 3 + ############################################### # mode: CustomConfig # ###############################################