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 openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -27487,7 +27487,7 @@
"$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension"
},
"vsphereStorageDriver": {
"description": "VSphereStorageDriver indicates the storage driver to use on VSphere clusters. Once this field is set to CSIWithMigrationDriver, it can not be changed. 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.",
"description": "VSphereStorageDriver indicates the storage driver to use on VSphere clusters. Once this field is set to CSIWithMigrationDriver, it can not be changed. If this is empty, the platform will choose a good default, which may change over time without notice. The current default is CSIWithMigrationDriver and may not be changed. DEPRECATED: This field will be removed in a future release.",
"type": "string",
"default": ""
}
Expand Down
4 changes: 3 additions & 1 deletion operator/v1/0000_50_cluster_storage_operator_01_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ spec:
nullable: true
x-kubernetes-preserve-unknown-fields: true
vsphereStorageDriver:
description: 'VSphereStorageDriver indicates the storage driver to use on VSphere clusters. Once this field is set to CSIWithMigrationDriver, it can not be changed. 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.'
description: 'VSphereStorageDriver indicates the storage driver to use on VSphere clusters. Once this field is set to CSIWithMigrationDriver, it can not be changed. If this is empty, the platform will choose a good default, which may change over time without notice. The current default is CSIWithMigrationDriver and may not be changed. DEPRECATED: This field will be removed in a future release.'
type: string
enum:
- ""
Expand All @@ -79,6 +79,8 @@ spec:
x-kubernetes-validations:
- rule: oldSelf != "CSIWithMigrationDriver" || self == "CSIWithMigrationDriver"
message: VSphereStorageDriver can not be changed once it is set to CSIWithMigrationDriver
- rule: self != "LegacyDeprecatedInTreeDriver"
message: VSphereStorageDriver can not be set to LegacyDeprecatedInTreeDriver
x-kubernetes-validations:
- rule: '!has(oldSelf.vsphereStorageDriver) || has(self.vsphereStorageDriver)'
message: VSphereStorageDriver is required once set
Expand Down
56 changes: 18 additions & 38 deletions operator/v1/stable.storage.testsuite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ tests:
spec:
logLevel: Normal
operatorLogLevel: Normal
onUpdate:
- name: Should allow enabling CSI migration for vSphere
onCreate:
- name: Should allow creating Storage with vsphere migration enabled
initial: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec: {} # No spec is required
updated: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
Expand All @@ -32,7 +28,16 @@ tests:
vsphereStorageDriver: CSIWithMigrationDriver
logLevel: Normal
operatorLogLevel: Normal
- name: Should allow disabling CSI migration for vSphere
onCreate:
- name: Should not allow creating Storage with vsphere migration disabled
initial: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
vsphereStorageDriver: LegacyDeprecatedInTreeDriver
expectedError: "VSphereStorageDriver can not be set to LegacyDeprecatedInTreeDriver"
onUpdate:
- name: Should allow enabling CSI migration for vSphere
initial: |
apiVersion: operator.openshift.io/v1
kind: Storage
Expand All @@ -41,32 +46,25 @@ tests:
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
vsphereStorageDriver: LegacyDeprecatedInTreeDriver
vsphereStorageDriver: CSIWithMigrationDriver
expected: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
vsphereStorageDriver: LegacyDeprecatedInTreeDriver
vsphereStorageDriver: CSIWithMigrationDriver
logLevel: Normal
operatorLogLevel: Normal
- name: Should allow changing LegacyDeprecatedInTreeDriver to CSIWithMigrationDriver
- name: Should not allow disabling CSI migration for vSphere
initial: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
vsphereStorageDriver: LegacyDeprecatedInTreeDriver
spec: {} # No spec is required
updated: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
vsphereStorageDriver: CSIWithMigrationDriver
expected: |
apiVersion: operator.openshift.io/v1
kind: Storage
spec:
vsphereStorageDriver: CSIWithMigrationDriver
logLevel: Normal
operatorLogLevel: Normal
vsphereStorageDriver: LegacyDeprecatedInTreeDriver
expectedError: "VSphereStorageDriver can not be set to LegacyDeprecatedInTreeDriver"
- name: Should not allow changing CSIWithMigrationDriver to LegacyDeprecatedInTreeDriver
initial: |
apiVersion: operator.openshift.io/v1
Expand Down Expand Up @@ -102,21 +100,3 @@ 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: 2 additions & 0 deletions operator/v1/types_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ type StorageSpec struct {
// Once this field is set to CSIWithMigrationDriver, it can not be changed.
// If this is empty, the platform will choose a good default,
// which may change over time without notice.
// The current default is CSIWithMigrationDriver and may not be changed.
// DEPRECATED: This field will be removed in a future release.
// +kubebuilder:validation:XValidation:rule="oldSelf != \"CSIWithMigrationDriver\" || self == \"CSIWithMigrationDriver\"",message="VSphereStorageDriver can not be changed once it is set to CSIWithMigrationDriver"
// +kubebuilder:validation:XValidation:rule="self != \"LegacyDeprecatedInTreeDriver\"",message="VSphereStorageDriver can not be set to LegacyDeprecatedInTreeDriver"
// +optional
VSphereStorageDriver StorageDriverType `json:"vsphereStorageDriver"`
}
Expand Down
2 changes: 1 addition & 1 deletion operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.