Skip to content

Commit fa2108c

Browse files
dlaw4608claude
andcommitted
Added ShareNetwork Controller for Manila Service
Implements ShareNetwork controller to manage Manila share networks. - E2E tests included - API configured - Manila enabled in CI Signed-off-by: Daniel Lawton <dlawton@redhat.com> Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent fa035e1 commit fa2108c

64 files changed

Lines changed: 3093 additions & 139 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
enabled_services: "openstack-cli-server,neutron-trunk,neutron-port-trusted-vif"
4242
conf_overrides: |
4343
enable_plugin neutron https://github.com/openstack/neutron ${{ matrix.openstack_version }}
44+
enable_plugin manila https://github.com/openstack/manila ${{ matrix.openstack_version }}
4445
4546
[[post-config|/etc/nova/nova.conf]]
4647
[filter_scheduler]

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ resources:
160160
kind: Service
161161
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
162162
version: v1alpha1
163+
- api:
164+
crdVersion: v1
165+
namespaced: true
166+
domain: k-orc.cloud
167+
group: openstack
168+
kind: ShareNetwork
169+
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
170+
version: v1alpha1
163171
- api:
164172
crdVersion: v1
165173
namespaced: true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ kubectl delete -f $ORC_RELEASE
9191
| server | |||
9292
| server group | |||
9393
| service | |||
94+
| share network | |||
9495
| subnet | |||
9596
| trunk | |||
9697
| user | |||

api/v1alpha1/sharenetwork_types.go

Lines changed: 38 additions & 20 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.
@@ -38,14 +41,6 @@ type ShareNetworkResourceSpec struct {
3841
// +optional
3942
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subnetRef is immutable"
4043
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"`
4944
}
5045

5146
// ShareNetworkFilter defines an existing resource by its properties
@@ -60,15 +55,11 @@ type ShareNetworkFilter struct {
6055
// +kubebuilder:validation:MaxLength:=255
6156
// +optional
6257
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
6758
}
6859

6960
// ShareNetworkResourceStatus represents the observed state of the resource.
7061
type ShareNetworkResourceStatus struct {
71-
// name is a Human-readable name for the resource. Might not be unique.
62+
// name is a Human-readable name for the resource.
7263
// +kubebuilder:validation:MaxLength=1024
7364
// +optional
7465
Name string `json:"name,omitempty"`
@@ -78,17 +69,44 @@ type ShareNetworkResourceStatus struct {
7869
// +optional
7970
Description string `json:"description,omitempty"`
8071

81-
// networkID is the ID of the Network to which the resource is associated.
72+
// neutronNetID is the Neutron network ID.
73+
// +kubebuilder:validation:MaxLength=1024
74+
// +optional
75+
NeutronNetID string `json:"neutronNetID,omitempty"`
76+
77+
// neutronSubnetID is the Neutron subnet ID.
8278
// +kubebuilder:validation:MaxLength=1024
8379
// +optional
84-
NetworkID string `json:"networkID,omitempty"`
80+
NeutronSubnetID string `json:"neutronSubnetID,omitempty"`
8581

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

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
91+
// cidr is the CIDR of the subnet.
92+
// +kubebuilder:validation:MaxLength=1024
93+
// +optional
94+
CIDR string `json:"cidr"`
95+
96+
// ipVersion is the IP version (4 or 6).
97+
// +optional
98+
IPVersion *int32 `json:"ipVersion,omitempty"`
99+
100+
// projectID is the ID of the project that owns the share network.
101+
// +kubebuilder:validation:MaxLength=1024
102+
// +optional
103+
ProjectID string `json:"projectID,omitempty"`
104+
105+
// createdAt shows the date and time when the resource was created.
106+
// +optional
107+
CreatedAt *metav1.Time `json:"createdAt,omitempty"`
108+
109+
// updatedAt shows the date and time when the resource was updated.
110+
// +optional
111+
UpdatedAt *metav1.Time `json:"updatedAt,omitempty"`
94112
}

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)