Skip to content

Commit b573540

Browse files
committed
fix(tenant): fail loudly when computeplane is enabled without its package
The computeplane-application package ships in the iaas bundle while the toggle arrives with tenant-rd in the system bundle, and bundles are independent booleans. Refuse the render with a clear diagnostic instead of producing a HelmRelease that retries a nonexistent artifact forever. Assisted-By: Claude <[email protected]> Signed-off-by: Andrei Kvapil <[email protected]>
1 parent 7e65f73 commit b573540

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎packages/apps/tenant/templates/computeplane.yaml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
cozystack/community.
1010
*/}}
1111
{{- if .Values.computeplane }}
12+
{{- /*
13+
Fail loudly when the module is toggled on without its backing package: the
14+
computeplane-application package ships in the iaas bundle while this toggle
15+
arrives with tenant-rd in the system bundle, and bundles are independent
16+
booleans. Without this guard a system+paas install would render a
17+
HelmRelease pointing at a nonexistent ExternalArtifact and retry forever
18+
with no diagnostic. The Capabilities gate keeps the check active in-cluster
19+
(the Package CRD is always installed there) while letting offline renders
20+
(helm template / helm-unittest, where lookup returns nothing) pass.
21+
*/}}
22+
{{- if .Capabilities.APIVersions.Has "cozystack.io/v1alpha1" }}
23+
{{- if not (lookup "cozystack.io/v1alpha1" "Package" "" "cozystack.computeplane-application") }}
24+
{{- fail "computeplane module is enabled, but the cozystack.computeplane-application package is not installed — it ships in the iaas bundle (set bundles.iaas.enabled: true)" }}
25+
{{- end }}
26+
{{- end }}
1227
apiVersion: helm.toolkit.fluxcd.io/v2
1328
kind: HelmRelease
1429
metadata:

0 commit comments

Comments
 (0)