@@ -18,71 +18,75 @@ package v1alpha1
1818
1919// EndpointResourceSpec contains the desired state of the resource.
2020type 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
4850type 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.
6967type 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}
0 commit comments