mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-06 12:03:39 +09:00
Backport of #3409 to release-1.5.
gateway-hostname-policy.yaml and route-hostname-policy.yaml rendered
their ValidatingAdmissionPolicy and binding documents unconditionally,
so installing the chart against an API server that does not serve
admissionregistration.k8s.io/v1/ValidatingAdmissionPolicy failed.
Guard both on the capability, matching the existing pattern in
packages/core/platform/templates/deletion-protection.yaml, and declare
the capability in the two rendering test suites so they keep exercising
the policies.
hostname-policies-capability-gate_test.yaml pins the absent-API case at
suite level, since helm-unittest merges per-test capabilities into the
suite's rather than replacing them.
The upstream change also gated a third template,
ingress-hostname-policy.yaml. That legacy-Ingress hostname policy
landed on main in d89ad7069 and was never backported, so it does not
exist on release-1.5 and is deliberately excluded here: importing it
would ship an unreviewed admission policy that starts rejecting tenant
Ingress hostnames in a patch release.
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>