@@ -18,11 +18,6 @@ package v1alpha1
1818
1919// RegisteredLimitResourceSpec contains the desired state of the resource.
2020type RegisteredLimitResourceSpec 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
@@ -34,51 +29,64 @@ type RegisteredLimitResourceSpec struct {
3429 // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serviceRef is immutable"
3530 ServiceRef KubernetesNameRef `json:"serviceRef,omitempty"`
3631
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/registeredlimits
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"`
32+ // resourceName is name of the resource to be limited.
33+ // +kubebuilder:validation:MinLength:=1
34+ // +kubebuilder:validation:MaxLength:=255
35+ // +required
36+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="resourceName is immutable"
37+ ResourceName string `json:"resourceName,omitempty"`
38+
39+ // defaultLimit is limit of the specified resource in the given context.
40+ // +kubebuilder:validation:Minimum=-1
41+ // +required
42+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="defaultLimit is immutable"
43+ DefaultLimit int32 `json:"defaultLimit,omitempty"`
4444}
4545
4646// RegisteredLimitFilter defines an existing resource by its properties
4747// +kubebuilder:validation:MinProperties:=1
4848type RegisteredLimitFilter struct {
49- // name of the existing resource
50- // +optional
51- Name * OpenStackName `json:"name,omitempty"`
52-
5349 // description of the existing resource
5450 // +kubebuilder:validation:MinLength:=1
5551 // +kubebuilder:validation:MaxLength:=255
5652 // +optional
5753 Description * string `json:"description,omitempty"`
5854
59- // TODO(scaffolding): Add more types.
60- // To see what is supported, you can take inspiration from the ListOpts structure from
61- // github.com/gophercloud/gophercloud/v2/openstack/identity/v3/registeredlimits
55+ // serviceRef is a reference to the ORC Service which this resource is associated with.
56+ // +optional
57+ ServiceRef * KubernetesNameRef `json:"serviceRef,omitempty"`
58+
59+ // resourceName is name of the resource to be limited.
60+ // +kubebuilder:validation:MinLength:=1
61+ // +kubebuilder:validation:MaxLength:=255
62+ // +optional
63+ ResourceName * string `json:"resourceName,omitempty"`
6264}
6365
6466// RegisteredLimitResourceStatus represents the observed state of the resource.
6567type RegisteredLimitResourceStatus struct {
66- // name is a Human-readable name for the resource. Might not be unique.
67- // +kubebuilder:validation:MaxLength=1024
68- // +optional
69- Name string `json:"name,omitempty"`
70-
7168 // description is a human-readable description for the resource.
7269 // +kubebuilder:validation:MaxLength=1024
7370 // +optional
7471 Description string `json:"description,omitempty"`
7572
76- // serviceID is the ID of the Service to which the resource is associated.
77- // +kubebuilder:validation:MaxLength=1024
73+ // resourceName is name of the resource to be limited.
74+ // +kubebuilder:validation:MinLength:=1
75+ // +kubebuilder:validation:MaxLength:=255
76+ // +optional
77+ ResourceName string `json:"resourceName,omitempty"`
78+
79+ // regionID is the ID of the region that contains the service endpoint.
80+ // +kubebuilder:validation:MaxLength:=1024
81+ // +optional
82+ RegionID string `json:"regionID,omitempty"`
83+
84+ // serviceID is a reference to the ORC Service which this resource is associated with.
85+ // +kubebuilder:validation:MaxLength:=1024
7886 // +optional
7987 ServiceID string `json:"serviceID,omitempty"`
8088
81- // TODO(scaffolding): Add more types .
82- // To see what is supported, you can take inspiration from the RegisteredLimit structure from
83- // github.com/gophercloud/gophercloud/v2/openstack/identity/v3/registeredlimits
89+ // defaultLimit is limit of the specified resource in the given context .
90+ // +optional
91+ DefaultLimit int32 `json:"defaultLimit,omitempty"`
8492}
0 commit comments