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
@@ -44,6 +45,8 @@ type VolumeGroupSnapshotSpec struct {
44
45
// object should be used.
45
46
// Exactly one of its members must be set.
46
47
// Members in VolumeGroupSnapshotSource are immutable.
48
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.selector) || has(self.selector)", message="selector is required once set"
49
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.volumeGroupSnapshotContentName) || has(self.volumeGroupSnapshotContentName)", message="volumeGroupSnapshotContentName is required once set"
47
50
typeVolumeGroupSnapshotSourcestruct {
48
51
// Selector is a label query over persistent volume claims that are to be
49
52
// grouped together for snapshotting.
@@ -53,6 +56,7 @@ type VolumeGroupSnapshotSource struct {
53
56
// Once a VolumeGroupSnapshotContent is created and the sidecar starts to process
54
57
// it, the volume list will not change with retries.
55
58
// +optional
59
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Spec.Source.Selector is immutable"
@@ -265,6 +270,9 @@ type VolumeGroupSnapshotContentSpec struct {
265
270
// VolumeGroupSnapshot object MUST be provided for binding to happen.
266
271
// This field is immutable after creation.
267
272
// 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"
// DeletionPolicy determines whether this VolumeGroupSnapshotContent and the
@@ -347,11 +355,14 @@ type VolumeGroupSnapshotContentStatus struct {
347
355
// VolumeGroupSnapshotContentSource represents the CSI source of a group snapshot.
348
356
// Exactly one of its members must be set.
349
357
// Members in VolumeGroupSnapshotContentSource are immutable.
358
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.volumeHandle) || has(self.volumeHandle)", message="volumeHandle is required once set"
359
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.groupSnapshotHandles) || has(self.groupSnapshotHandles)", message="groupSnapshotHandles is required once set"
350
360
typeVolumeGroupSnapshotContentSourcestruct {
351
361
// VolumeHandles is a list of volume handles on the backend to be snapshotted
352
362
// together. It is specified for dynamic provisioning of the VolumeGroupSnapshot.
353
363
// This field is immutable.
354
364
// +optional
365
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Spec.Source.VolumeHandle is immutable"
@@ -99,6 +100,8 @@ type VolumeSnapshotSpec struct {
99
100
// object should be used.
100
101
// Exactly one of its members must be set.
101
102
// Members in VolumeSnapshotSource are immutable.
103
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.persistentVolumeClaimName) || has(self.persistentVolumeClaimName)", message="persistentVolumeClaimName is required once set"
104
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.volumeSnapshotContentName) || has(self.volumeSnapshotContentName)", message="volumeSnapshotContentName is required once set"
102
105
typeVolumeSnapshotSourcestruct {
103
106
// persistentVolumeClaimName specifies the name of the PersistentVolumeClaim
104
107
// object representing the volume from which a snapshot should be created.
@@ -108,13 +111,15 @@ type VolumeSnapshotSource struct {
108
111
// created.
109
112
// This field is immutable.
110
113
// +optional
114
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Spec.Source.PersistentVolumeClaimName is immutable"
@@ -289,6 +294,7 @@ type VolumeSnapshotContentList struct {
289
294
}
290
295
291
296
// VolumeSnapshotContentSpec is the specification of a VolumeSnapshotContent
297
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.sourceVolumeMode) || has(self.sourceVolumeMode)", message="sourceVolumeMode is required once set"
292
298
typeVolumeSnapshotContentSpecstruct {
293
299
// volumeSnapshotRef specifies the VolumeSnapshot object to which this
294
300
// VolumeSnapshotContent object is bound.
@@ -298,6 +304,7 @@ type VolumeSnapshotContentSpec struct {
298
304
// VolumeSnapshot object MUST be provided for binding to happen.
299
305
// This field is immutable after creation.
300
306
// Required.
307
+
// +kubebuilder:validation:XValidation:rule="has(self.name) && has(self.__namespace__)",message="both spec.volumeSnapshotRef.name and spec.volumeSnapshotRef.namespace must be set"
0 commit comments