Skip to content

Commit 4d3e5db

Browse files
committed
keystone: endpoint controller implementation
Signed-off-by: Winicius Silva <winiciusab12@gmail.com>
1 parent 1dc3714 commit 4d3e5db

File tree

67 files changed

+1265
-337
lines changed

Some content is hidden

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

67 files changed

+1265
-337
lines changed

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ resources:
1616
kind: Domain
1717
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
1818
version: v1alpha1
19+
- api:
20+
crdVersion: v1
21+
namespaced: true
22+
domain: k-orc.cloud
23+
group: openstack
24+
kind: Endpoint
25+
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
26+
version: v1alpha1
1927
- api:
2028
crdVersion: v1
2129
namespaced: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ kubectl delete -f $ORC_RELEASE
7171
| **controller** | **1.x** | **2.x** | **main** |
7272
|:---------------------------:|:-------:|:-------:|:--------:|
7373
| domain | |||
74+
| endpoint | |||
7475
| flavor | |||
7576
| floating ip | |||
7677
| group | |||
@@ -91,7 +92,6 @@ kubectl delete -f $ORC_RELEASE
9192
| volume type | |||
9293

9394

94-
9595
✔: mostly implemented
9696

9797
◐: partially implemented

api/v1alpha1/endpoint_types.go

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,71 +18,75 @@ package v1alpha1
1818

1919
// EndpointResourceSpec contains the desired state of the resource.
2020
type EndpointResourceSpec 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-
2621
// description is a human-readable description for the resource.
2722
// +kubebuilder:validation:MinLength:=1
2823
// +kubebuilder:validation:MaxLength:=255
2924
// +optional
3025
Description *string `json:"description,omitempty"`
3126

27+
// enabled indicates whether the endpoint is enabled or not.
28+
// +kubebuilder:default:=true
29+
// +optional
30+
Enabled *bool `json:"enabled,omitempty"`
31+
32+
// interface indicates the visibility of the endpoint.
33+
// +kubebuilder:validation:Enum:=admin;internal;public
34+
// +required
35+
Interface string `json:"interface,omitempty"`
36+
37+
// url is the endpoint URL.
38+
// +kubebuilder:validation:MaxLength=1024
39+
// +required
40+
URL string `json:"url"`
41+
3242
// serviceRef is a reference to the ORC Service which this resource is associated with.
3343
// +required
3444
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serviceRef is immutable"
3545
ServiceRef KubernetesNameRef `json:"serviceRef,omitempty"`
36-
37-
// TODO(scaffolding): Add more types.
38-
// To see what is supported, you can take inspiration from the CreateOpts structure from
39-
// github.com/gophercloud/gophercloud/v2/openstack/identity/v3/endpoints
40-
//
41-
// Until you have implemented mutability for the field, you must add a CEL validation
42-
// preventing the field being modified:
43-
// `// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="<fieldname> is immutable"`
4446
}
4547

4648
// EndpointFilter defines an existing resource by its properties
4749
// +kubebuilder:validation:MinProperties:=1
4850
type EndpointFilter struct {
49-
// name of the existing resource
51+
// interface of the existing endpoint.
52+
// +kubebuilder:validation:Enum:=admin;internal;public
5053
// +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"`
54+
Interface string `json:"interface,omitempty"`
5855

5956
// serviceRef is a reference to the ORC Service which this resource is associated with.
6057
// +optional
6158
ServiceRef *KubernetesNameRef `json:"serviceRef,omitempty"`
6259

63-
// TODO(scaffolding): Add more types.
64-
// To see what is supported, you can take inspiration from the ListOpts structure from
65-
// github.com/gophercloud/gophercloud/v2/openstack/identity/v3/endpoints
60+
// url is the URL of the existing endpoint.
61+
// +kubebuilder:validation:MaxLength=1024
62+
// +optional
63+
URL string `json:"url,omitempty"`
6664
}
6765

6866
// EndpointResourceStatus represents the observed state of the resource.
6967
type EndpointResourceStatus struct {
70-
// name is a Human-readable name for the resource. Might not be unique.
71-
// +kubebuilder:validation:MaxLength=1024
68+
// description is a human-readable description for the resource.
69+
// +kubebuilder:validation:MinLength:=1
70+
// +kubebuilder:validation:MaxLength:=255
71+
// +optional
72+
Description string `json:"description,omitempty"`
73+
74+
// enabled indicates whether the endpoint is enabled or not.
7275
// +optional
73-
Name string `json:"name,omitempty"`
76+
Enabled bool `json:"enabled,omitempty"`
7477

75-
// description is a human-readable description for the resource.
78+
// interface indicates the visibility of the endpoint.
79+
// +kubebuilder:validation:MaxLength=128
80+
// +optional
81+
Interface string `json:"interface,omitempty"`
82+
83+
// url is the endpoint URL.
7684
// +kubebuilder:validation:MaxLength=1024
7785
// +optional
78-
Description string `json:"description,omitempty"`
86+
URL string `json:"url,omitempty"`
7987

8088
// serviceID is the ID of the Service to which the resource is associated.
8189
// +kubebuilder:validation:MaxLength=1024
8290
// +optional
8391
ServiceID string `json:"serviceID,omitempty"`
84-
85-
// TODO(scaffolding): Add more types.
86-
// To see what is supported, you can take inspiration from the Endpoint structure from
87-
// github.com/gophercloud/gophercloud/v2/openstack/identity/v3/endpoints
8892
}

api/v1alpha1/zz_generated.deepcopy.go

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