Skip to content

Commit e367bc0

Browse files
committed
endpoint: generate code with scaffolding tool
go run ./cmd/scaffold-controller \ -interactive=false \ -kind Endpoint \ -gophercloud-client NewIdentityV3 \ -gophercloud-module github.com/gophercloud/gophercloud/v2/openstack/identity/v3/endpoints \ -required-create-dependency Service Signed-off-by: Winicius Silva <winiciusab12@gmail.com>
1 parent 48a9a5e commit e367bc0

File tree

67 files changed

+3403
-0
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

+3403
-0
lines changed

api/v1alpha1/endpoint_types.go

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
Copyright 2025 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+
// EndpointResourceSpec contains the desired state of the resource.
20+
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+
26+
// description is a human-readable description for the resource.
27+
// +kubebuilder:validation:MinLength:=1
28+
// +kubebuilder:validation:MaxLength:=255
29+
// +optional
30+
Description *string `json:"description,omitempty"`
31+
32+
// serviceRef is a reference to the ORC Service which this resource is associated with.
33+
// +required
34+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serviceRef is immutable"
35+
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"`
44+
}
45+
46+
// EndpointFilter defines an existing resource by its properties
47+
// +kubebuilder:validation:MinProperties:=1
48+
type EndpointFilter 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+
// serviceRef is a reference to the ORC Service which this resource is associated with.
60+
// +optional
61+
ServiceRef *KubernetesNameRef `json:"serviceRef,omitempty"`
62+
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
66+
}
67+
68+
// EndpointResourceStatus represents the observed state of the resource.
69+
type EndpointResourceStatus struct {
70+
// name is a Human-readable name for the resource. Might not be unique.
71+
// +kubebuilder:validation:MaxLength=1024
72+
// +optional
73+
Name string `json:"name,omitempty"`
74+
75+
// description is a human-readable description for the resource.
76+
// +kubebuilder:validation:MaxLength=1024
77+
// +optional
78+
Description string `json:"description,omitempty"`
79+
80+
// serviceID is the ID of the Service to which the resource is associated.
81+
// +kubebuilder:validation:MaxLength=1024
82+
// +optional
83+
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
88+
}

api/v1alpha1/zz_generated.endpoint-resource.go

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