Skip to content

Commit 46a7c89

Browse files
authored
Merge pull request #691 from dlaw4608/share_network
Manila: Share network
2 parents c560970 + fa2108c commit 46a7c89

91 files changed

Lines changed: 4760 additions & 0 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: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/*
2+
Copyright 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+
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
20+
21+
// 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"
23+
type ShareNetworkResourceSpec struct {
24+
// name will be the name of the created resource. If not specified, the
25+
// name of the ORC object will be used.
26+
// +optional
27+
Name *OpenStackName `json:"name,omitempty"`
28+
29+
// description is a human-readable description for the resource.
30+
// +kubebuilder:validation:MinLength:=1
31+
// +kubebuilder:validation:MaxLength:=255
32+
// +optional
33+
Description *string `json:"description,omitempty"`
34+
35+
// networkRef is a reference to the ORC Network which this resource is associated with.
36+
// +optional
37+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="networkRef is immutable"
38+
NetworkRef *KubernetesNameRef `json:"networkRef,omitempty"`
39+
40+
// subnetRef is a reference to the ORC Subnet which this resource is associated with.
41+
// +optional
42+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subnetRef is immutable"
43+
SubnetRef *KubernetesNameRef `json:"subnetRef,omitempty"`
44+
}
45+
46+
// ShareNetworkFilter defines an existing resource by its properties
47+
// +kubebuilder:validation:MinProperties:=1
48+
type ShareNetworkFilter struct {
49+
// name of the existing resource
50+
// +optional
51+
Name *OpenStackName `json:"name,omitempty"`
52+
53+
// description of the existing resource
54+
// +kubebuilder:validation:MinLength:=1
55+
// +kubebuilder:validation:MaxLength:=255
56+
// +optional
57+
Description *string `json:"description,omitempty"`
58+
}
59+
60+
// ShareNetworkResourceStatus represents the observed state of the resource.
61+
type ShareNetworkResourceStatus struct {
62+
// name is a Human-readable name for the resource.
63+
// +kubebuilder:validation:MaxLength=1024
64+
// +optional
65+
Name string `json:"name,omitempty"`
66+
67+
// description is a human-readable description for the resource.
68+
// +kubebuilder:validation:MaxLength=1024
69+
// +optional
70+
Description string `json:"description,omitempty"`
71+
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.
78+
// +kubebuilder:validation:MaxLength=1024
79+
// +optional
80+
NeutronSubnetID string `json:"neutronSubnetID,omitempty"`
81+
82+
// networkType is the network type (e.g., vlan, vxlan, flat).
83+
// +kubebuilder:validation:MaxLength=1024
84+
// +optional
85+
NetworkType string `json:"networkType,omitempty"`
86+
87+
// segmentationID is the segmentation ID of the network.
88+
// +optional
89+
SegmentationID *int32 `json:"segmentationID,omitempty"`
90+
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"`
112+
}

api/v1alpha1/zz_generated.deepcopy.go

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