Files
cozystack/packages/system
Ivan Okhotnikov 522fb534a7 test(vertical-pod-autoscaler): helm-unittest coverage for cert-manager migration paths
Locks in the four configurations the chart must support:

  1. certManagerEnabled=true (default): Certificate + Issuer render
     with the same DNS shape (`vpa-webhook.<ns>.svc`) and validity
     (365d) the legacy genSignedCert produced, so cert-manager
     adoption of an existing Secret rotates content once and stays
     stable. Legacy Secret is suppressed. The checksum/tls-secret
     podAnnotation — the ReplicaSet-churn amplifier of the legacy
     path — is absent. A future refactor that reintroduces that
     annotation on the cert-manager branch would silently regress
     to the same infinite rotation loop from a different angle;
     this test blocks that.

  2. certManagerEnabled=false: opt-out for operators without cert-
     manager. Legacy Secret must be back AND the
     checksum/tls-secret annotation must be back — either one alone
     leaves admission-controller pods failing to mount.

  3. existingSecret set: operator supplies TLS out-of-band. Chart
     mints nothing (no Certificate, no Issuer, no legacy Secret, no
     migration or rollout hook). Preserves the pre-existing chart
     contract.

  4. admissionController.enabled=false (nested vpa-for-vpa release):
     no admission-controller means no TLS Secret is needed. Every
     admission-controller template must render zero documents,
     otherwise the nested release would apply stray
     Certificate/Issuer/Job manifests into cozy-vpa-for-vpa for no
     reason.

Also locks the hook wiring for tls-migrator (pre-upgrade, weight -10)
and tls-rollout (post-install,post-upgrade, weight 10) and asserts
the RBAC scoping-by-resourceName so a future edit cannot accidentally
grant broader Secret/Deployment access than the Job requires.

All 22 tests pass locally under helm-unittest.

Signed-off-by: Ivan Okhotnikov <ivan.okhotnikov@aenix.io>
2026-07-02 18:57:01 +03:00
..
2026-06-22 10:55:37 +00:00
2026-03-25 15:57:25 +05:00
2026-06-22 10:55:37 +00:00
2026-06-22 10:55:37 +00:00
2026-02-10 20:19:03 +01:00
2026-06-22 10:55:37 +00:00
2026-03-25 15:57:25 +05:00