-
Notifications
You must be signed in to change notification settings - Fork 47
Add flavor extra_specs #817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ type VolumeTypeResourceSpec struct { | |
| // +kubebuilder:validation:MaxItems:=64 | ||
| // +listType=atomic | ||
| // +optional | ||
| ExtraSpecs []VolumeTypeExtraSpec `json:"extraSpecs,omitempty"` | ||
| ExtraSpecs []ExtraSpec `json:"extraSpecs,omitempty"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above: The A CEL validation rule on the field would catch this at admission time: // +kubebuilder:validation:XValidation:rule="self.all(x, self.filter(y, y.name == x.name).size() == 1)",message="extraSpecs names must be unique"
ExtraSpecs []ExtraSpec `json:"extraSpecs,omitempty"` |
||
|
|
||
| // isPublic indicates whether the volume type is public. | ||
| // +optional | ||
|
|
@@ -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"` | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
[]ExtraSpecslice has no uniqueness constraint onname. If a user specifies the same name twice,extraSpecsToMapsilently uses the last value - no error or warning at admission time.A CEL validation rule on the field would catch this at admission time: