Skip to content

Commit df85f23

Browse files
authored
Merge pull request #507 from shiftstack/volumetype-controller-v2
VolumeType controller
2 parents f93d141 + 5c17b15 commit df85f23

File tree

81 files changed

+4244
-8
lines changed

Some content is hidden

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

81 files changed

+4244
-8
lines changed

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,12 @@ resources:
104104
kind: Subnet
105105
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
106106
version: v1alpha1
107+
- api:
108+
crdVersion: v1
109+
namespaced: true
110+
domain: k-orc.cloud
111+
group: openstack
112+
kind: VolumeType
113+
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
114+
version: v1alpha1
107115
version: "3"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ kubectl delete -f $ORC_RELEASE
7878
| server | |||
7979
| server group | |||
8080
| subnet | |||
81+
| volume type | |||
8182

8283
✔: mostly implemented
8384

api/v1alpha1/volumetype_types.go

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*
2+
Copyright 2025 The ORC Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
// VolumeTypeResourceSpec contains the desired state of the resource.
20+
type VolumeTypeResourceSpec struct {
21+
// name will be the name of the created resource. If not specified, the
22+
// name of the ORC object will be used.
23+
// +optional
24+
Name *OpenStackName `json:"name,omitempty"`
25+
26+
// description is a human-readable description for the resource.
27+
// +kubebuilder:validation:MinLength:=1
28+
// +kubebuilder:validation:MaxLength:=255
29+
// +optional
30+
Description *string `json:"description,omitempty"`
31+
32+
// extraSpecs is a map of key-value pairs that define extra specifications for the volume type.
33+
// +kubebuilder:validation:MaxItems:=32
34+
// +listType=atomic
35+
// +optional
36+
ExtraSpecs []VolumeTypeExtraSpec `json:"extraSpecs,omitempty"`
37+
38+
// isPublic indicates whether the volume type is public.
39+
// +optional
40+
IsPublic *bool `json:"isPublic,omitempty"`
41+
}
42+
43+
// VolumeTypeFilter defines an existing resource by its properties
44+
// +kubebuilder:validation:MinProperties:=1
45+
type VolumeTypeFilter struct {
46+
// name of the existing resource
47+
// +optional
48+
Name *OpenStackName `json:"name,omitempty"`
49+
50+
// description of the existing resource
51+
// +kubebuilder:validation:MinLength:=1
52+
// +kubebuilder:validation:MaxLength:=255
53+
// +optional
54+
Description *string `json:"description,omitempty"`
55+
56+
// isPublic indicates whether the VolumeType is public.
57+
// +optional
58+
IsPublic *bool `json:"isPublic,omitempty"`
59+
}
60+
61+
// VolumeTypeResourceStatus represents the observed state of the resource.
62+
type VolumeTypeResourceStatus struct {
63+
// name is a Human-readable name for the resource. Might not be unique.
64+
// +kubebuilder:validation:MaxLength=1024
65+
// +optional
66+
Name string `json:"name,omitempty"`
67+
68+
// description is a human-readable description for the resource.
69+
// +kubebuilder:validation:MaxLength=1024
70+
// +optional
71+
Description string `json:"description,omitempty"`
72+
73+
// extraSpecs is a map of key-value pairs that define extra specifications for the volume type.
74+
// +kubebuilder:validation:MaxItems:=32
75+
// +listType=atomic
76+
// +optional
77+
ExtraSpecs []VolumeTypeExtraSpecStatus `json:"extraSpecs"`
78+
79+
// isPublic indicates whether the VolumeType is public.
80+
// +optional
81+
IsPublic *bool `json:"isPublic"`
82+
}
83+
84+
type VolumeTypeExtraSpec struct {
85+
// name is the name of the extraspec
86+
// +kubebuilder:validation:MaxLength:=255
87+
// +required
88+
Name string `json:"name"`
89+
90+
// value is the value of the extraspec
91+
// +kubebuilder:validation:MaxLength:=255
92+
// +required
93+
Value string `json:"value"`
94+
}
95+
96+
type VolumeTypeExtraSpecStatus struct {
97+
// name is the name of the extraspec
98+
// +kubebuilder:validation:MaxLength:=255
99+
// +optional
100+
Name string `json:"name,omitempty"`
101+
102+
// value is the value of the extraspec
103+
// +kubebuilder:validation:MaxLength:=255
104+
// +optional
105+
Value string `json:"value,omitempty"`
106+
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 267 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)