@@ -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,65 @@ 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+ // +kubebuilder:validation:Maximum=2147483647
42+ // +required
43+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="defaultLimit is immutable"
44+ DefaultLimit * int32 `json:"defaultLimit,omitempty"`
4445}
4546
4647// RegisteredLimitFilter defines an existing resource by its properties
4748// +kubebuilder:validation:MinProperties:=1
4849type RegisteredLimitFilter struct {
49- // name of the existing resource
50- // +optional
51- Name * OpenStackName `json:"name,omitempty"`
52-
5350 // description of the existing resource
5451 // +kubebuilder:validation:MinLength:=1
5552 // +kubebuilder:validation:MaxLength:=255
5653 // +optional
5754 Description * string `json:"description,omitempty"`
5855
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
56+ // serviceRef is a reference to the ORC Service which this resource is associated with.
57+ // +optional
58+ ServiceRef * KubernetesNameRef `json:"serviceRef,omitempty"`
59+
60+ // resourceName is name of the resource to be limited.
61+ // +kubebuilder:validation:MinLength:=1
62+ // +kubebuilder:validation:MaxLength:=255
63+ // +optional
64+ ResourceName * string `json:"resourceName,omitempty"`
6265}
6366
6467// RegisteredLimitResourceStatus represents the observed state of the resource.
6568type 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-
7169 // description is a human-readable description for the resource.
7270 // +kubebuilder:validation:MaxLength=1024
7371 // +optional
7472 Description string `json:"description,omitempty"`
7573
76- // serviceID is the ID of the Service to which the resource is associated.
77- // +kubebuilder:validation:MaxLength=1024
74+ // resourceName is name of the resource to be limited.
75+ // +kubebuilder:validation:MinLength:=1
76+ // +kubebuilder:validation:MaxLength:=255
77+ // +optional
78+ ResourceName string `json:"resourceName,omitempty"`
79+
80+ // regionID is the ID of the region that contains the service endpoint.
81+ // +kubebuilder:validation:MaxLength:=1024
82+ // +optional
83+ RegionID string `json:"regionID,omitempty"`
84+
85+ // serviceID is a reference to the ORC Service which this resource is associated with.
86+ // +kubebuilder:validation:MaxLength:=1024
7887 // +optional
7988 ServiceID string `json:"serviceID,omitempty"`
8089
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
90+ // defaultLimit is limit of the specified resource in the given context .
91+ // +optional
92+ DefaultLimit int32 `json:"defaultLimit,omitempty"`
8493}
0 commit comments