Skip to content

Commit 33eeddc

Browse files
HiranAdikariclaude
andcommitted
Fix secret type and skip Terminating namespaces at startup
- Change harvesterconfig Secret type from non-standard "secret" to "Opaque" to match Kubernetes convention and avoid potential filtering by Rancher controllers - Skip Terminating namespaces in the initial pass by reading deletionTimestamp from the jq pipeline; prevents failed kubectl apply calls against namespaces in the process of being deleted Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3d3e117 commit 33eeddc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • modules/management/namespace-credential-provisioner/scripts

modules/management/namespace-credential-provisioner/scripts/reconcile.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ metadata:
124124
v2prov-authorized-secret-deletes-on-cluster-removal: "true"
125125
v2prov-secret-authorized-for-cluster: "${cluster_name}"
126126
platform.wso2.com/credential-source-namespace: "${vm_namespace}"
127-
type: secret
127+
type: Opaque
128128
stringData:
129129
credential: |
130130
$(echo "$kubeconfig" | sed 's/^/ /')
@@ -400,9 +400,11 @@ kubectl get namespaces -o json | jq -r '
400400
[
401401
.metadata.name,
402402
(.metadata.annotations["field.cattle.io/projectId"] // ""),
403-
(.metadata.labels["platform.wso2.com/role"] // "")
403+
(.metadata.labels["platform.wso2.com/role"] // ""),
404+
(.metadata.deletionTimestamp // "")
404405
] | join("\u0001")
405-
' | while IFS=$'\x01' read -r ns project_id role; do
406+
' | while IFS=$'\x01' read -r ns project_id role deletion_ts; do
407+
[[ -n "$deletion_ts" ]] && continue
406408
[[ -z "$project_id" ]] && continue
407409
is_system_namespace "$ns" && continue
408410
[[ "$role" == "network-namespace" ]] && continue

0 commit comments

Comments
 (0)