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
2 changes: 1 addition & 1 deletion operator/v1/0000_50_cluster_storage_operator_01_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
- LegacyDeprecatedInTreeDriver
- CSIWithMigrationDriver
x-kubernetes-validations:
- rule: self == oldSelf || oldSelf == "" || self == "CSIWithMigrationDriver"
- rule: oldSelf != "CSIWithMigrationDriver" || self == "CSIWithMigrationDriver"
message: VSphereStorageDriver can not be changed once it is set to CSIWithMigrationDriver
x-kubernetes-validations:
- rule: '!has(oldSelf.vsphereStorageDriver) || has(self.vsphereStorageDriver)'
Expand Down
18 changes: 18 additions & 0 deletions operator/v1/stable.storage.testsuite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,21 @@ tests:
kind: Storage
spec: {}
expectedError: "VSphereStorageDriver is required once set"
- name: Should allow changing LegacyDeprecatedInTreeDriver to empty string
initial: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
vsphereStorageDriver: LegacyDeprecatedInTreeDriver
updated: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
vsphereStorageDriver: ""
expected: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
vsphereStorageDriver: ""
logLevel: Normal
operatorLogLevel: Normal
2 changes: 1 addition & 1 deletion operator/v1/types_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type StorageSpec struct {
// If this is empty, the platform will choose a good default,
// which may change over time without notice.
// DEPRECATED: This field will be removed in a future release.
// +kubebuilder:validation:XValidation:rule="self == oldSelf || oldSelf == \"\" || self == \"CSIWithMigrationDriver\"",message="VSphereStorageDriver can not be changed once it is set to CSIWithMigrationDriver"
// +kubebuilder:validation:XValidation:rule="oldSelf != \"CSIWithMigrationDriver\" || self == \"CSIWithMigrationDriver\"",message="VSphereStorageDriver can not be changed once it is set to CSIWithMigrationDriver"
// +optional
VSphereStorageDriver StorageDriverType `json:"vsphereStorageDriver"`
}
Expand Down