Skip to content

Commit 4d72a18

Browse files
committed
Implements ShareType controller to manage Manila share types resource
- E2E tests included - API configured Signed-off-by: Daniel Lawton <dlawton@redhat.com>
1 parent feb33e0 commit 4d72a18

77 files changed

Lines changed: 2987 additions & 651 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ resources:
168168
kind: ShareNetwork
169169
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
170170
version: v1alpha1
171+
- api:
172+
crdVersion: v1
173+
namespaced: true
174+
domain: k-orc.cloud
175+
group: openstack
176+
kind: ShareType
177+
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
178+
version: v1alpha1
171179
- api:
172180
crdVersion: v1
173181
namespaced: true

api/v1alpha1/sharetype_types.go

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,28 @@ limitations under the License.
1717
package 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"
2022
type 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
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 229 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)