You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -47,6 +47,7 @@ type VolumeGroupSnapshotSpec struct {
47
47
// Members in VolumeGroupSnapshotSource are immutable.
48
48
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.selector) || has(self.selector)", message="selector is required once set"
49
49
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.volumeGroupSnapshotContentName) || has(self.volumeGroupSnapshotContentName)", message="volumeGroupSnapshotContentName is required once set"
50
+
// +kubebuilder:validation:XValidation:rule="(has(self.selector) && !has(self.volumeGroupSnapshotContentName)) || (!has(self.selector) && has(self.volumeGroupSnapshotContentName))", message="exactly one of selector and volumeGroupSnapshotContentName must be set"
50
51
typeVolumeGroupSnapshotSourcestruct {
51
52
// Selector is a label query over persistent volume claims that are to be
52
53
// grouped together for snapshotting.
@@ -56,7 +57,7 @@ type VolumeGroupSnapshotSource struct {
56
57
// Once a VolumeGroupSnapshotContent is created and the sidecar starts to process
57
58
// it, the volume list will not change with retries.
58
59
// +optional
59
-
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Spec.Source.Selector is immutable"
60
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="selector is immutable"
@@ -270,9 +271,8 @@ type VolumeGroupSnapshotContentSpec struct {
270
271
// VolumeGroupSnapshot object MUST be provided for binding to happen.
271
272
// This field is immutable after creation.
272
273
// Required.
273
-
// +kubebuilder:validation:XValidation:rule="has(self.name) && has(self.__namespace__)",message="both Spec.VolumeGroupSnapshotRef.Name and Spec.VolumeGroupSnapshotRef.Namespace must be set"
274
-
// +kubebuilder:validation:XValidation:rule="self.name == oldSelf.name",message="Spec.VolumeGroupSnapshotRef.Name is immutable"
275
-
// +kubebuilder:validation:XValidation:rule="self.__namespace__ == oldSelf.__namespace__",message="Spec.VolumeGroupSnapshotRef.Namespace is immutable"
274
+
// +kubebuilder:validation:XValidation:rule="has(self.name) && has(self.__namespace__)",message="both volumeGroupSnapshotRef.name and volumeGroupSnapshotRef.namespace must be set"
275
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="volumeGroupSnapshotRef is immutable"
// DeletionPolicy determines whether this VolumeGroupSnapshotContent and the
@@ -355,14 +355,15 @@ type VolumeGroupSnapshotContentStatus struct {
355
355
// VolumeGroupSnapshotContentSource represents the CSI source of a group snapshot.
356
356
// Exactly one of its members must be set.
357
357
// Members in VolumeGroupSnapshotContentSource are immutable.
358
-
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.volumeHandle) || has(self.volumeHandle)", message="volumeHandle is required once set"
358
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.volumeHandles) || has(self.volumeHandles)", message="volumeHandles is required once set"
359
359
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.groupSnapshotHandles) || has(self.groupSnapshotHandles)", message="groupSnapshotHandles is required once set"
360
+
// +kubebuilder:validation:XValidation:rule="(has(self.volumeHandles) && !has(self.groupSnapshotHandles)) || (!has(self.volumeHandles) && has(self.groupSnapshotHandles))", message="exactly one of volumeHandles and groupSnapshotHandles must be set"
360
361
typeVolumeGroupSnapshotContentSourcestruct {
361
362
// VolumeHandles is a list of volume handles on the backend to be snapshotted
362
363
// together. It is specified for dynamic provisioning of the VolumeGroupSnapshot.
363
364
// This field is immutable.
364
365
// +optional
365
-
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Spec.Source.VolumeHandle is immutable"
366
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="volumeHandles is immutable"
Copy file name to clipboardExpand all lines: client/apis/volumesnapshot/v1/types.go
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,7 @@ type VolumeSnapshotSpec struct {
102
102
// Members in VolumeSnapshotSource are immutable.
103
103
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.persistentVolumeClaimName) || has(self.persistentVolumeClaimName)", message="persistentVolumeClaimName is required once set"
104
104
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.volumeSnapshotContentName) || has(self.volumeSnapshotContentName)", message="volumeSnapshotContentName is required once set"
105
+
// +kubebuilder:validation:XValidation:rule="(has(self.volumeSnapshotContentName) && !has(self.persistentVolumeClaimName)) || (!has(self.volumeSnapshotContentName) && has(self.persistentVolumeClaimName))", message="exactly one of volumeSnapshotContentName and persistentVolumeClaimName must be set"
105
106
typeVolumeSnapshotSourcestruct {
106
107
// persistentVolumeClaimName specifies the name of the PersistentVolumeClaim
107
108
// object representing the volume from which a snapshot should be created.
@@ -111,15 +112,15 @@ type VolumeSnapshotSource struct {
111
112
// created.
112
113
// This field is immutable.
113
114
// +optional
114
-
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Spec.Source.PersistentVolumeClaimName is immutable"
115
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="persistentVolumeClaimName is immutable"
@@ -356,20 +357,21 @@ type VolumeSnapshotContentSpec struct {
356
357
// Members in VolumeSnapshotContentSource are immutable.
357
358
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.volumeHandle) || has(self.volumeHandle)", message="volumeHandle is required once set"
358
359
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.snapshotHandle) || has(self.snapshotHandle)", message="snapshotHandle is required once set"
360
+
// +kubebuilder:validation:XValidation:rule="(has(self.volumeHandle) && !has(self.snapshotHandle)) || (!has(self.volumeHandle) && has(self.snapshotHandle))", message="exactly one of volumeHandle and snapshotHandle must be set"
359
361
typeVolumeSnapshotContentSourcestruct {
360
362
// volumeHandle specifies the CSI "volume_id" of the volume from which a snapshot
361
363
// should be dynamically taken from.
362
364
// This field is immutable.
363
365
// +optional
364
-
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Spec.Source.VolumeHandle is immutable"
366
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="volumeHandle is immutable"
0 commit comments