Add kubebuilder example and validation

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
This commit is contained in:
Fredrik Lönnegren 2023-12-21 11:06:53 +01:00 committed by Fredrik Lönnegren
parent ba56f153aa
commit e3545e8b2c
3 changed files with 10 additions and 5 deletions

View File

@ -2674,8 +2674,9 @@ spec:
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
targetPlatform:
description: Platform specifies the target platform to build the seedimage
for.
description: 'Platform specifies the target platform for the built
image. Example: linux/amd64'
pattern: ^$|^\S+\/\S+$
type: string
type:
default: iso

View File

@ -54,7 +54,10 @@ type SeedImageSpec struct {
// +kubebuilder:validation:Enum=iso;raw
// +kubebuilder:default:=iso
Type SeedImageType `json:"type"`
// Platform specifies the target platform to build the seedimage for.
// Platform specifies the target platform for the built image. Example: linux/amd64
// +kubebuilder:example=linux/amd64
// +kubebuilder:validation:Pattern=`^$|^\S+\/\S+$`
// +kubebuilder:validation:Type=string
// +optional
TargetPlatform Platform `json:"targetPlatform"`
// CloudConfig contains cloud-config data to be put in the generated iso.

View File

@ -124,8 +124,9 @@ spec:
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
targetPlatform:
description: Platform specifies the target platform to build the seedimage
for.
description: 'Platform specifies the target platform for the built
image. Example: linux/amd64'
pattern: ^$|^\S+\/\S+$
type: string
type:
default: iso