Skip to content

Revert "K8SPG-771 | Use CEL for validating that volumeSnapshots.className required"#1536

Merged
mayankshah1607 merged 1 commit intomainfrom
revert-1532-K8SPG-771-validation-fix
Apr 2, 2026
Merged

Revert "K8SPG-771 | Use CEL for validating that volumeSnapshots.className required"#1536
mayankshah1607 merged 1 commit intomainfrom
revert-1532-K8SPG-771-validation-fix

Conversation

@mayankshah1607
Copy link
Copy Markdown
Member

Reverts #1532

We were able to overcome the Openshift problem by specifying in olm-examples:

"volumeSnapshots": {
  "className": "default",
  "mode": "offline",
  "offlineConfig": {
    "checkpoint": {
      "enabled": true,
      "timeoutSeconds": 300
   }
  }
}

It makes this fix useless, and we should go back to the conventional way of performing such validations

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-validations CEL rule for volumeSnapshots.className with an OpenAPI required: [className] schema requirement.
  • Update the Go API type so className is required (non-omitempty) and annotated as required for CRD generation.
  • Switch Jenkins pipeline agent labels from docker to docker-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
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

  1. Problem: ClassName is marked required, but there is no validation preventing an empty string, so className: "" will pass the CRD schema.
  2. Why it matters: This is a behavioral regression from the previous CEL rule (self.className != "") and can silently disable volume snapshot backups (IsVolumeSnapshotsEnabled() checks ClassName != "").
  3. Fix: Add a non-empty constraint (e.g., +kubebuilder:validation:MinLength=1 or 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

Copilot uses AI. Check for mistakes.
@JNKPercona
Copy link
Copy Markdown
Collaborator

Test Name Result Time
backup-enable-disable passed 00:00:00
builtin-extensions passed 00:00:00
cert-manager-tls passed 00:00:00
custom-envs passed 00:00:00
custom-extensions passed 00:00:00
custom-tls passed 00:00:00
database-init-sql passed 00:00:00
demand-backup passed 00:00:00
demand-backup-offline-snapshot passed 00:14:27
dynamic-configuration passed 00:00:00
finalizers passed 00:00:00
init-deploy passed 00:00:00
huge-pages passed 00:00:00
major-upgrade-13-to-14 passed 00:00:00
major-upgrade-14-to-15 passed 00:00:00
major-upgrade-15-to-16 passed 00:00:00
major-upgrade-16-to-17 passed 00:00:00
major-upgrade-17-to-18 passed 00:00:00
ldap passed 00:00:00
ldap-tls passed 00:00:00
monitoring passed 00:00:00
monitoring-pmm3 passed 00:00:00
one-pod passed 00:00:00
operator-self-healing passed 00:00:00
pitr passed 00:00:00
scaling passed 00:00:00
scheduled-backup passed 00:00:00
self-healing passed 00:00:00
sidecars passed 00:00:00
standby-pgbackrest passed 00:00:00
standby-streaming passed 00:00:00
start-from-backup passed 00:00:00
tablespaces passed 00:00:00
telemetry-transfer passed 00:00:00
upgrade-consistency passed 00:00:00
upgrade-minor passed 00:00:00
users passed 00:00:00
Summary Value
Tests Run 37/37
Job Duration 00:36:29
Total Test Time 00:14:27

commit: bf00bdd
image: perconalab/percona-postgresql-operator:PR-1536-bf00bdde0

@mayankshah1607 mayankshah1607 merged commit 142f00e into main Apr 2, 2026
21 checks passed
@mayankshah1607 mayankshah1607 deleted the revert-1532-K8SPG-771-validation-fix branch April 2, 2026 11:04
jvpasinatto pushed a commit that referenced this pull request Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants