Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ pipeline {
AUTHOR_NAME = sh(script: "echo ${CHANGE_AUTHOR_EMAIL} | awk -F'@' '{print \$1}'", , returnStdout: true).trim()
}
agent {
label 'docker'
label 'docker-x64-min'
}
options {
disableConcurrentBuilds(abortPrevious: true)
Expand Down Expand Up @@ -535,7 +535,7 @@ pipeline {
parallel {
stage('cluster1') {
agent {
label 'docker'
label 'docker-x64-min'
}
steps {
prepareNode()
Expand All @@ -545,7 +545,7 @@ pipeline {
}
stage('cluster2') {
agent {
label 'docker'
label 'docker-x64-min'
}
steps {
prepareNode()
Expand All @@ -555,7 +555,7 @@ pipeline {
}
stage('cluster3') {
agent {
label 'docker'
label 'docker-x64-min'
}
steps {
prepareNode()
Expand All @@ -565,7 +565,7 @@ pipeline {
}
stage('cluster4') {
agent {
label 'docker'
label 'docker-x64-min'
}
steps {
prepareNode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9775,10 +9775,9 @@ spec:
https://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax
minLength: 6
type: string
required:
- className
type: object
x-kubernetes-validations:
- message: className is required
rule: has(self.className) && self.className != ""
type: object
x-kubernetes-validations:
- message: At least one repository must be configured when backups
Expand Down
5 changes: 2 additions & 3 deletions config/crd/bases/pgv2.percona.com_perconapgclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10470,10 +10470,9 @@ spec:
https://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax
minLength: 6
type: string
required:
- className
type: object
x-kubernetes-validations:
- message: className is required
rule: has(self.className) && self.className != ""
type: object
x-kubernetes-validations:
- message: At least one repository must be configured when backups
Expand Down
5 changes: 2 additions & 3 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10767,10 +10767,9 @@ spec:
https://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax
minLength: 6
type: string
required:
- className
type: object
x-kubernetes-validations:
- message: className is required
rule: has(self.className) && self.className != ""
type: object
x-kubernetes-validations:
- message: At least one repository must be configured when backups
Expand Down
5 changes: 2 additions & 3 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10767,10 +10767,9 @@ spec:
https://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax
minLength: 6
type: string
required:
- className
type: object
x-kubernetes-validations:
- message: className is required
rule: has(self.className) && self.className != ""
type: object
x-kubernetes-validations:
- message: At least one repository must be configured when backups
Expand Down
5 changes: 2 additions & 3 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10767,10 +10767,9 @@ spec:
https://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax
minLength: 6
type: string
required:
- className
type: object
x-kubernetes-validations:
- message: className is required
rule: has(self.className) && self.className != ""
type: object
x-kubernetes-validations:
- message: At least one repository must be configured when backups
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,6 @@ const (
VolumeSnapshotModeOffline VolumeSnapshotMode = "offline"
)

// +kubebuilder:validation:XValidation:rule="has(self.className) && self.className != \"\"",message="className is required"
type VolumeSnapshots struct {
// Mode of the VolumeSnapshot.
// +kubebuilder:validation:Enum={offline}
Expand All @@ -647,7 +646,8 @@ type VolumeSnapshots struct {
Mode VolumeSnapshotMode `json:"mode,omitempty"`

// 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.
ClassName string `json:"className"`

// Defines the Cron schedule for a VolumeSnapshot.
// Follows the standard Cron schedule syntax:
Expand Down
Loading