Skip to content

chore: add volume snapshot crd check#10306

Open
shanshanying wants to merge 1 commit into
mainfrom
support/helm-volumesnapshot-crd-check
Open

chore: add volume snapshot crd check#10306
shanshanying wants to merge 1 commit into
mainfrom
support/helm-volumesnapshot-crd-check

Conversation

@shanshanying

Copy link
Copy Markdown
Contributor

No description provided.

@shanshanying shanshanying requested a review from a team as a code owner May 28, 2026 08:50
@shanshanying shanshanying added pick-1.0 Auto cherry-pick to release-1.0 when PR merged pick-1.1 Auto cherry-pick to release-1.1 when PR merged labels May 28, 2026
@apecloud-bot

Copy link
Copy Markdown
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.1

@github-actions github-actions Bot added the size/M Denotes a PR that changes 30-99 lines. label May 28, 2026
@shanshanying shanshanying force-pushed the support/helm-volumesnapshot-crd-check branch from 576bf8f to 0fdaa1a Compare May 28, 2026 09:40
@shanshanying shanshanying force-pushed the support/helm-volumesnapshot-crd-check branch from 0fdaa1a to 13f60cb Compare May 28, 2026 09:46
@apecloud-bot apecloud-bot added the approved PR Approved Test label May 28, 2026
{{- 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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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") -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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") -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR Approved Test pick-1.0 Auto cherry-pick to release-1.0 when PR merged pick-1.1 Auto cherry-pick to release-1.1 when PR merged size/M Denotes a PR that changes 30-99 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants