Skip to content

Commit bc22e2b

Browse files
dlaw4608claude
andcommitted
Added ShareNetwork Controller for Manila
Implements ShareNetwork controller to manage Manila share networks. - E2E tests included - API configured - Manila enabled in CI Signed-off-by: Daniel Lawton <[email protected]> Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent 25763e3 commit bc22e2b

63 files changed

Lines changed: 3092 additions & 152 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.

.github/workflows/e2e.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ jobs:
3636
with:
3737
enable_workaround_docker_io: 'false'
3838
branch: ${{ matrix.openstack_version }}
39-
enabled_services: "openstack-cli-server,neutron-trunk"
39+
enabled_services: "openstack-cli-server,neutron-trunk,manila,m-api,m-sch,m-shr,m-dat"
40+
conf_overrides: |
41+
enable_plugin manila https://github.com/openstack/manila ${{ matrix.openstack_version }}
4042
4143
- name: Deploy a Kind Cluster
4244
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ resources:
144144
kind: Service
145145
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
146146
version: v1alpha1
147+
- api:
148+
crdVersion: v1
149+
namespaced: true
150+
domain: k-orc.cloud
151+
group: openstack
152+
kind: ShareNetwork
153+
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
154+
version: v1alpha1
147155
- api:
148156
crdVersion: v1
149157
namespaced: true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ kubectl delete -f $ORC_RELEASE
8383
| role | |||
8484
| router | |||
8585
| security group (incl. rule) | |||
86+
| share network | |||
8687
| server | |||
8788
| server group | |||
8889
| service | |||

api/v1alpha1/sharenetwork_types.go

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ limitations under the License.
1616

1717
package v1alpha1
1818

19+
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
20+
1921
// ShareNetworkResourceSpec contains the desired state of the resource.
22+
// +kubebuilder:validation:XValidation:rule="has(self.networkRef) == has(self.subnetRef)",message="networkRef and subnetRef must be specified together"
2023
type ShareNetworkResourceSpec struct {
2124
// name will be the name of the created resource. If not specified, the
2225
// name of the ORC object will be used.
@@ -31,21 +34,11 @@ type ShareNetworkResourceSpec struct {
3134

3235
// networkRef is a reference to the ORC Network which this resource is associated with.
3336
// +optional
34-
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="networkRef is immutable"
3537
NetworkRef *KubernetesNameRef `json:"networkRef,omitempty"`
3638

3739
// subnetRef is a reference to the ORC Subnet which this resource is associated with.
3840
// +optional
39-
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subnetRef is immutable"
4041
SubnetRef *KubernetesNameRef `json:"subnetRef,omitempty"`
41-
42-
// TODO(scaffolding): Add more types.
43-
// To see what is supported, you can take inspiration from the CreateOpts structure from
44-
// github.com/gophercloud/gophercloud/v2/openstack/sharedfilesystems/v2/sharenetworks
45-
//
46-
// Until you have implemented mutability for the field, you must add a CEL validation
47-
// preventing the field being modified:
48-
// `// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="<fieldname> is immutable"`
4942
}
5043

5144
// ShareNetworkFilter defines an existing resource by its properties
@@ -60,15 +53,11 @@ type ShareNetworkFilter struct {
6053
// +kubebuilder:validation:MaxLength:=255
6154
// +optional
6255
Description *string `json:"description,omitempty"`
63-
64-
// TODO(scaffolding): Add more types.
65-
// To see what is supported, you can take inspiration from the ListOpts structure from
66-
// github.com/gophercloud/gophercloud/v2/openstack/sharedfilesystems/v2/sharenetworks
6756
}
6857

6958
// ShareNetworkResourceStatus represents the observed state of the resource.
7059
type ShareNetworkResourceStatus struct {
71-
// name is a Human-readable name for the resource. Might not be unique.
60+
// name is a Human-readable name for the resource.
7261
// +kubebuilder:validation:MaxLength=1024
7362
// +optional
7463
Name string `json:"name,omitempty"`
@@ -78,17 +67,44 @@ type ShareNetworkResourceStatus struct {
7867
// +optional
7968
Description string `json:"description,omitempty"`
8069

81-
// networkID is the ID of the Network to which the resource is associated.
70+
// neutronNetID is the Neutron network ID.
71+
// +kubebuilder:validation:MaxLength=1024
72+
// +optional
73+
NeutronNetID string `json:"neutronNetID,omitempty"`
74+
75+
// neutronSubnetID is the Neutron subnet ID.
8276
// +kubebuilder:validation:MaxLength=1024
8377
// +optional
84-
NetworkID string `json:"networkID,omitempty"`
78+
NeutronSubnetID string `json:"neutronSubnetID,omitempty"`
8579

86-
// subnetID is the ID of the Subnet to which the resource is associated.
80+
// networkType is the network type (e.g., vlan, vxlan, flat).
8781
// +kubebuilder:validation:MaxLength=1024
8882
// +optional
89-
SubnetID string `json:"subnetID,omitempty"`
83+
NetworkType string `json:"networkType,omitempty"`
84+
85+
// segmentationID is the segmentation ID.
86+
// +optional
87+
SegmentationID *int32 `json:"segmentationID,omitempty"`
9088

91-
// TODO(scaffolding): Add more types.
92-
// To see what is supported, you can take inspiration from the ShareNetwork structure from
93-
// github.com/gophercloud/gophercloud/v2/openstack/sharedfilesystems/v2/sharenetworks
89+
// cidr is the CIDR of the subnet.
90+
// +kubebuilder:validation:MaxLength=1024
91+
// +optional
92+
CIDR string `json:"cidr,omitempty"`
93+
94+
// ipVersion is the IP version (4 or 6).
95+
// +optional
96+
IPVersion *int32 `json:"ipVersion,omitempty"`
97+
98+
// projectID is the ID of the project that owns the share network.
99+
// +kubebuilder:validation:MaxLength=1024
100+
// +optional
101+
ProjectID string `json:"projectID,omitempty"`
102+
103+
// createdAt shows the date and time when the resource was created.
104+
// +optional
105+
CreatedAt *metav1.Time `json:"createdAt,omitempty"`
106+
107+
// updatedAt shows the date and time when the resource was updated.
108+
// +optional
109+
UpdatedAt *metav1.Time `json:"updatedAt,omitempty"`
94110
}

api/v1alpha1/zz_generated.deepcopy.go

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