@@ -17,25 +17,28 @@ limitations under the License.
1717package v1alpha1
1818
1919// ShareTypeResourceSpec contains the desired state of the resource.
20+ // All fields are immutable after creation.
21+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ShareTypeResourceSpec is immutable"
2022type ShareTypeResourceSpec struct {
2123 // name will be the name of the created resource. If not specified, the
2224 // name of the ORC object will be used.
2325 // +optional
2426 Name * OpenStackName `json:"name,omitempty"`
2527
26- // description is a human-readable description for the resource.
27- // +kubebuilder:validation:MinLength:=1
28- // +kubebuilder:validation:MaxLength:=255
28+ // isPublic indicates whether a share type is publicly accessible.
29+ // +kubebuilder:default:=true
2930 // +optional
30- Description * string `json:"description ,omitempty"`
31+ IsPublic * bool `json:"isPublic ,omitempty"`
3132
32- // TODO(scaffolding): Add more types.
33- // To see what is supported, you can take inspiration from the CreateOpts structure from
34- // github.com/gophercloud/gophercloud/v2/openstack/sharedfilesystems/v2/sharetypes
35- //
36- // Until you have implemented mutability for the field, you must add a CEL validation
37- // preventing the field being modified:
38- // `// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="<fieldname> is immutable"`
33+ // driverHandlesShareServers defines the driver mode for share server, or storage, life cycle management.
34+ // This is a required extra specification for share types.
35+ // +kubebuilder:default:=true
36+ // +optional
37+ DriverHandlesShareServers * bool `json:"driverHandlesShareServers,omitempty"`
38+
39+ // snapshotSupport filters back ends by whether they do or do not support share snapshots.
40+ // +optional
41+ SnapshotSupport * bool `json:"snapshotSupport,omitempty"`
3942}
4043
4144// ShareTypeFilter defines an existing resource by its properties
@@ -45,15 +48,9 @@ type ShareTypeFilter struct {
4548 // +optional
4649 Name * OpenStackName `json:"name,omitempty"`
4750
48- // description of the existing resource
49- // +kubebuilder:validation:MinLength:=1
50- // +kubebuilder:validation:MaxLength:=255
51+ // isPublic selects public types, private types, or both
5152 // +optional
52- Description * string `json:"description,omitempty"`
53-
54- // TODO(scaffolding): Add more types.
55- // To see what is supported, you can take inspiration from the ListOpts structure from
56- // github.com/gophercloud/gophercloud/v2/openstack/sharedfilesystems/v2/sharetypes
53+ IsPublic * bool `json:"isPublic,omitempty"`
5754}
5855
5956// ShareTypeResourceStatus represents the observed state of the resource.
@@ -63,12 +60,11 @@ type ShareTypeResourceStatus struct {
6360 // +optional
6461 Name string `json:"name,omitempty"`
6562
66- // description is a human-readable description for the resource.
67- // +kubebuilder:validation:MaxLength=1024
63+ // isPublic indicates whether a share type is publicly accessible.
6864 // +optional
69- Description string `json:"description ,omitempty"`
65+ IsPublic bool `json:"isPublic ,omitempty"`
7066
71- // TODO(scaffolding): Add more types .
72- // To see what is supported, you can take inspiration from the ShareType structure from
73- // github.com/gophercloud/gophercloud/v2/openstack/sharedfilesystems/v2/sharetypes
67+ // extraSpecs contains the extra specifications for the share type .
68+ // +optional
69+ ExtraSpecs map [ string ] string `json:"extraSpecs,omitempty"`
7470}
0 commit comments