Fix: Preserve webhook caBundle during failed Helm upgrades#224
Conversation
f8bab00 to
1c4f105
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #224 +/- ##
==========================================
+ Coverage 62.49% 70.19% +7.70%
==========================================
Files 62 62
Lines 4415 5009 +594
==========================================
+ Hits 2759 3516 +757
+ Misses 1324 1142 -182
- Partials 332 351 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1c4f105 to
2a46685
Compare
2a46685 to
54d711a
Compare
…ssion webhooks --- Signed-off-by: Anaswara Suresh <anaswarasuresh2212@gmail.com> Co-Authored-By: Anaswara Suresh <anaswarasuresh2212@gmail.com> Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
54d711a to
98e5e6f
Compare
|
https://github.com/kubevela/kubevela/blob/master/.github/workflows/webhook-upgrade-validation.yml Similar to the above action, create a verification GitHub action for this fix |
Signed-off-by: Anaswara Suresh <anaswarasuresh2212@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
@vishal210893 added the GHA, here is a sample run from my fork |
Description of your changes
Prevent vela-workflow Helm installs and upgrades from leaving
ValidatingWebhookConfiguration/MutatingWebhookConfigurationin a broken state with a placeholdercaBundle: Cg==.Problem
The Helm chart deploys webhook configurations with a hardcoded placeholder
caBundle: Cg==and relies on a post-install/post-upgrade Job to patch the real CA bundle. If Helm fails before the patch Job completes (timeout, image pull error, controller CrashLoopBackOff with--wait, etc.), the webhooks persist with an invalid caBundle — silently bypassing admission validation.Fix (mirrors kubevela/kubevela#6919)
Preserve existing caBundle with Helm
lookup— on upgrade, the webhook templates read the existing resource from the cluster and reuse its caBundle instead of overwriting withCg==. Falls back toCg==only on fresh install (expected; the patch Job handles it).Add
post-rollbackhook — the patch Job and its RBAC resources now also run after Helm rollbacks to restore the caBundle.Checklist
make reviewableto ensure this PR is ready for reviewbackport release-x.ylabels to auto-backport this PR if necessaryHow has this code been tested
Reproduced on a k3d cluster (K3s v1.31.5, arm64):
Reference: kubevela/kubevela#6919 (same fix applied to the vela-core chart)
Special notes for your reviewer
lookupfunction supporthelm template/--dry-runstill works —lookupreturns nothing without cluster access, templates fall back toCg==, and the patch Job handles it at runtimeadmissionWebhooks.certManager.enabled=true, patch jobs are disabled and cert-manager injects the caBundle via annotationsSummary by cubic
Preserves the admission webhooks’ caBundle on Helm installs, upgrades, and rollbacks to avoid broken webhooks when hooks fail. Requires Helm 3.2+.
Written for commit 53d7669. Summary will update on new commits.