Skip to content

[patch] resoved jdbccfg stuck in deletion - #596

Open
sumitjain-1901 wants to merge 4 commits into
mainfrom
MASCORE-13967-deprov
Open

sumitjain-1901 wants to merge 4 commits into
mainfrom
MASCORE-13967-deprov

Conversation

@sumitjain-1901

Copy link
Copy Markdown
Contributor

Issue:

https://jsw.ibm.com/browse/MASCORE-13967

Root Cause & Fix

The PostDelete Job in postdelete-delete-db2-user_Job.yaml was broken in two ways

  1. SA/Role/RoleBinding were PreSync hooks — ArgoCD deleted them immediately after provisioning, so the PostDelete Job had no RBAC when it ran during deprovisioning.

  2. AWS credentials were injected via secretKeyRef: name: aws — the aws secret only exists in mas--syncres, not in mas--core where the Job runs, causing CreateContainerConfigError. Worse, the config repo passes sm_aws_access_key_id/sm_aws_secret_access_key as AVP path:arn:... placeholders; AVP resolves these at manifest-generation time, so if the upstream AWS SM secret is deleted (e.g. during deprovisioning), ArgoCD enters a permanent ComparisonError and deletion is completely blocked.

Fix: Changed SA/Role/RoleBinding to PostDelete hooks. Added a NetworkPolicy for egress. Replaced secretKeyRef env vars with a Role+RoleBinding PostDelete hook in mas--syncres granting the Job SA get on the aws secret, and moved credential reads to runtime inside the Job script via oc get secret aws -n ${SYNCRES_NS} — eliminating all AVP placeholders from the Job's env entirely.

Testing

Testing on inst1015
before:
image

after deletion:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants