Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions api/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,27 @@ type KubernetesNameRef string
// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MaxLength:=64
type KeystoneName string

type ExtraSpec struct {
// name is the name of the extraspec
// +kubebuilder:validation:MaxLength:=255
// +required
Name string `json:"name"`

// value is the value of the extraspec
// +kubebuilder:validation:MaxLength:=255
// +required
Value string `json:"value"`
}

type ExtraSpecStatus struct {
// name is the name of the extraspec
// +kubebuilder:validation:MaxLength:=255
// +optional
Name string `json:"name,omitempty"`

// value is the value of the extraspec
// +kubebuilder:validation:MaxLength:=255
// +optional
Value string `json:"value,omitempty"`
}
22 changes: 21 additions & 1 deletion api/v1alpha1/flavor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
package v1alpha1

// FlavorResourceSpec contains the desired state of a flavor
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="FlavorResourceSpec is immutable"
type FlavorResourceSpec struct {
// name will be the name of the created resource. If not specified, the
// name of the ORC object will be used.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable"
// +optional
Name *OpenStackName `json:"name,omitempty"`

Expand All @@ -29,22 +29,26 @@ type FlavorResourceSpec struct {
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=255
// +kubebuilder:validation:Pattern=^[a-zA-Z0-9._-]([a-zA-Z0-9. _-]*[a-zA-Z0-9._-])?$
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="id is immutable"
// +optional
ID string `json:"id,omitempty"` //nolint:kubeapilinter // intentionally allow raw ID

// description contains a free form description of the flavor.
// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MaxLength:=65535
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="description is immutable"
// +optional
Description *string `json:"description,omitempty"`

// ram is the memory of the flavor, measured in MB.
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ram is immutable"
// +required
RAM int32 `json:"ram,omitempty"`

// vcpus is the number of vcpus for the flavor.
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="vcpus is immutable"
// +required
Vcpus int32 `json:"vcpus,omitempty"`

Expand All @@ -57,16 +61,25 @@ type FlavorResourceSpec struct {
// zero root disk via the
// os_compute_api:servers:create:zero_disk_flavor policy rule.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="disk is immutable"
// +required
Disk int32 `json:"disk"`

// swap is the size of a dedicated swap disk that will be allocated, in
// MiB. If 0 (the default), no dedicated swap disk will be created.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="swap is immutable"
// +optional
Swap int32 `json:"swap,omitempty"`

// extraSpecs is a map of key-value pairs that define extra specifications for the flavor.
// +kubebuilder:validation:MaxItems:=128
// +listType=atomic
// +optional
ExtraSpecs []ExtraSpec `json:"extraSpecs,omitempty"`

// isPublic flags a flavor as being available to all projects or not.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="isPublic is immutable"
// +optional
IsPublic *bool `json:"isPublic,omitempty"`

Expand All @@ -75,6 +88,7 @@ type FlavorResourceSpec struct {
// be used as a scratch space for applications that are aware of its
// limitations. Defaults to 0.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ephemeral is immutable"
// +optional
Ephemeral int32 `json:"ephemeral,omitempty"`
}
Expand Down Expand Up @@ -131,6 +145,12 @@ type FlavorResourceStatus struct {
// +optional
Swap *int32 `json:"swap,omitempty"`

// extraSpecs is a map of key-value pairs that define extra specifications for the flavor.
// +kubebuilder:validation:MaxItems:=128
// +listType=atomic
// +optional
ExtraSpecs []ExtraSpecStatus `json:"extraSpecs"`

// isPublic flags a flavor as being available to all projects or not.
// +optional
IsPublic *bool `json:"isPublic,omitempty"`
Expand Down
28 changes: 2 additions & 26 deletions api/v1alpha1/volumetype_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type VolumeTypeResourceSpec struct {
// +kubebuilder:validation:MaxItems:=64
// +listType=atomic
// +optional
ExtraSpecs []VolumeTypeExtraSpec `json:"extraSpecs,omitempty"`
ExtraSpecs []ExtraSpec `json:"extraSpecs,omitempty"`

// isPublic indicates whether the volume type is public.
// +optional
Expand Down Expand Up @@ -74,33 +74,9 @@ type VolumeTypeResourceStatus struct {
// +kubebuilder:validation:MaxItems:=64
// +listType=atomic
// +optional
ExtraSpecs []VolumeTypeExtraSpecStatus `json:"extraSpecs"`
ExtraSpecs []ExtraSpecStatus `json:"extraSpecs"`

// isPublic indicates whether the VolumeType is public.
// +optional
IsPublic *bool `json:"isPublic"`
}

type VolumeTypeExtraSpec struct {
// name is the name of the extraspec
// +kubebuilder:validation:MaxLength:=255
// +required
Name string `json:"name"`

// value is the value of the extraspec
// +kubebuilder:validation:MaxLength:=255
// +required
Value string `json:"value"`
}

type VolumeTypeExtraSpecStatus struct {
// name is the name of the extraspec
// +kubebuilder:validation:MaxLength:=255
// +optional
Name string `json:"name,omitempty"`

// value is the value of the extraspec
// +kubebuilder:validation:MaxLength:=255
// +optional
Value string `json:"value,omitempty"`
}
74 changes: 42 additions & 32 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading