chore: add volume snapshot crd check#10306
Conversation
|
Auto Cherry-pick Instructions |
576bf8f to
0fdaa1a
Compare
0fdaa1a to
13f60cb
Compare
| {{- end -}} | ||
| {{- if and .Values.installationChecks.volumeSnapshotCRDs (ne .Release.Name "test-release") -}} | ||
| {{- $requiredAPIs := list | ||
| (dict "api" "snapshot.storage.k8s.io/v1/VolumeSnapshotClass" "crd" "volumesnapshotclasses.snapshot.storage.k8s.io") |
There was a problem hiding this comment.
This only accepts the VolumeSnapshot v1 APIs, but the existing chart/runtime still supports snapshot.storage.k8s.io/v1beta1 through VOLUMESNAPSHOT_API_BETA and the compat client. A v1beta1-only cluster that previously worked would now be blocked at install time. The check should match the existing runtime contract by accepting either v1 or v1beta1, unless this PR intentionally removes v1beta1 support with a compatibility note.
| {{- fail (printf "\nKubeBlocks CRD check failed.\n\nMissing required CRDs:\n- %s\n\nInstall the KubeBlocks CRDs first:\n kubectl apply -f deploy/helm/crds\n\nTo skip this check, set:\n --set installationChecks.kubeblocksCRDs.enabled=false" (join "\n- " $missingKubeBlocksCRDs)) -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- if and .Values.installationChecks.volumeSnapshotCRDs (ne .Release.Name "test-release") -}} |
There was a problem hiding this comment.
This check should be gated by dataProtection.enabled. If users explicitly install only the core controller with dataProtection.enabled=false, VolumeSnapshot CRDs should not be required. Otherwise an optional DP dependency becomes a global installation prerequisite, which breaks lightweight/development installs.
| Validate optional installation preconditions. | ||
| */}} | ||
| {{- define "kubeblocks.installationChecks" -}} | ||
| {{- if and .Values.installationChecks.kubeblocksCRDs.enabled (ne .Release.Name "test-release") -}} |
There was a problem hiding this comment.
This default lookup-based check makes chart rendering depend on a live cluster. helm template kubeblocks deploy/helm now fails in offline/GitOps rendering when the CRDs are not already installed, and .github/workflows/release-crds.yml still runs that command with default values to generate kubeblocks.yaml. Please do not make default rendering depend on live-cluster state, or update all affected release/rendering workflows and document the new contract explicitly.
No description provided.