Revert "K8SPG-771 | Use CEL for validating that volumeSnapshots.className required"#1536
Merged
mayankshah1607 merged 1 commit intomainfrom Apr 2, 2026
Merged
Conversation
…Name req…" This reverts commit b5b76c4.
nmarukovich
approved these changes
Apr 1, 2026
gkech
approved these changes
Apr 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reverts the previously introduced CEL-based validation for spec.backups.volumeSnapshots.className and returns to an OpenAPI-schema “required” field approach, plus updates the Jenkins pipeline to run on a different agent label.
Changes:
- Replace the
x-kubernetes-validationsCEL rule forvolumeSnapshots.classNamewith an OpenAPIrequired: [className]schema requirement. - Update the Go API type so
classNameis required (non-omitempty) and annotated as required for CRD generation. - Switch Jenkins pipeline agent labels from
dockertodocker-x64-min.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go | Removes CEL validation and makes VolumeSnapshots.ClassName required in the API type. |
| Jenkinsfile | Updates pipeline/stage agents to use docker-x64-min. |
| deploy/cw-bundle.yaml | Updates bundled CRD schema to mark className as required (removes CEL rule). |
| deploy/crd.yaml | Updates CRD schema to mark className as required (removes CEL rule). |
| deploy/bundle.yaml | Updates bundled CRD schema to mark className as required (removes CEL rule). |
| config/crd/bases/pgv2.percona.com_perconapgclusters.yaml | Updates the base CRD schema to mark className as required (removes CEL rule). |
| build/crd/percona/generated/pgv2.percona.com_perconapgclusters.yaml | Updates generated CRD schema to mark className as required (removes CEL rule). |
|
|
||
| // Name of the VolumeSnapshotClass to use. | ||
| ClassName string `json:"className,omitempty"` | ||
| // +kubebuilder:validation:Required |
There was a problem hiding this comment.
- Problem:
ClassNameis marked required, but there is no validation preventing an empty string, soclassName: ""will pass the CRD schema. - Why it matters: This is a behavioral regression from the previous CEL rule (
self.className != "") and can silently disable volume snapshot backups (IsVolumeSnapshotsEnabled()checksClassName != ""). - Fix: Add a non-empty constraint (e.g.,
+kubebuilder:validation:MinLength=1or an appropriate pattern) and regenerate the CRD/bundle manifests so the schema rejects empty values.
Suggested change
| // +kubebuilder:validation:Required | |
| // +kubebuilder:validation:Required | |
| // +kubebuilder:validation:MinLength=1 |
egegunes
approved these changes
Apr 2, 2026
Collaborator
commit: bf00bdd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #1532
We were able to overcome the Openshift problem by specifying in olm-examples:
It makes this fix useless, and we should go back to the conventional way of performing such validations