@@ -17,10 +17,10 @@ limitations under the License.
1717package v1alpha1
1818
1919// FlavorResourceSpec contains the desired state of a flavor
20- // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="FlavorResourceSpec is immutable"
2120type FlavorResourceSpec struct {
2221 // name will be the name of the created resource. If not specified, the
2322 // name of the ORC object will be used.
23+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable"
2424 // +optional
2525 Name * OpenStackName `json:"name,omitempty"`
2626
@@ -29,22 +29,26 @@ type FlavorResourceSpec struct {
2929 // +kubebuilder:validation:MinLength=1
3030 // +kubebuilder:validation:MaxLength=255
3131 // +kubebuilder:validation:Pattern=^[a-zA-Z0-9._-]([a-zA-Z0-9. _-]*[a-zA-Z0-9._-])?$
32+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="id is immutable"
3233 // +optional
3334 ID string `json:"id,omitempty"` //nolint:kubeapilinter // intentionally allow raw ID
3435
3536 // description contains a free form description of the flavor.
3637 // +kubebuilder:validation:MinLength:=1
3738 // +kubebuilder:validation:MaxLength:=65535
39+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="description is immutable"
3840 // +optional
3941 Description * string `json:"description,omitempty"`
4042
4143 // ram is the memory of the flavor, measured in MB.
4244 // +kubebuilder:validation:Minimum=1
45+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ram is immutable"
4346 // +required
4447 RAM int32 `json:"ram,omitempty"`
4548
4649 // vcpus is the number of vcpus for the flavor.
4750 // +kubebuilder:validation:Minimum=1
51+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="vcpus is immutable"
4852 // +required
4953 Vcpus int32 `json:"vcpus,omitempty"`
5054
@@ -57,16 +61,25 @@ type FlavorResourceSpec struct {
5761 // zero root disk via the
5862 // os_compute_api:servers:create:zero_disk_flavor policy rule.
5963 // +kubebuilder:validation:Minimum=0
64+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="disk is immutable"
6065 // +required
6166 Disk int32 `json:"disk"`
6267
6368 // swap is the size of a dedicated swap disk that will be allocated, in
6469 // MiB. If 0 (the default), no dedicated swap disk will be created.
6570 // +kubebuilder:validation:Minimum=0
71+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="swap is immutable"
6672 // +optional
6773 Swap int32 `json:"swap,omitempty"`
6874
75+ // extraSpecs is a map of key-value pairs that define extra specifications for the flavor.
76+ // +kubebuilder:validation:MaxItems:=128
77+ // +listType=atomic
78+ // +optional
79+ ExtraSpecs []ExtraSpec `json:"extraSpecs,omitempty"`
80+
6981 // isPublic flags a flavor as being available to all projects or not.
82+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="isPublic is immutable"
7083 // +optional
7184 IsPublic * bool `json:"isPublic,omitempty"`
7285
@@ -75,6 +88,7 @@ type FlavorResourceSpec struct {
7588 // be used as a scratch space for applications that are aware of its
7689 // limitations. Defaults to 0.
7790 // +kubebuilder:validation:Minimum=0
91+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ephemeral is immutable"
7892 // +optional
7993 Ephemeral int32 `json:"ephemeral,omitempty"`
8094}
@@ -131,6 +145,12 @@ type FlavorResourceStatus struct {
131145 // +optional
132146 Swap * int32 `json:"swap,omitempty"`
133147
148+ // extraSpecs is a map of key-value pairs that define extra specifications for the flavor.
149+ // +kubebuilder:validation:MaxItems:=128
150+ // +listType=atomic
151+ // +optional
152+ ExtraSpecs []ExtraSpecStatus `json:"extraSpecs"`
153+
134154 // isPublic flags a flavor as being available to all projects or not.
135155 // +optional
136156 IsPublic * bool `json:"isPublic,omitempty"`
0 commit comments