Skip to content

Commit

Permalink
Merge pull request #2825 from NikhilSharmaWe/addMarkersForSizeSpec
Browse files Browse the repository at this point in the history
✨deploy-image/v1alpha: add validation markers for size spec
  • Loading branch information
k8s-ci-robot committed Jul 13, 2022
2 parents 08236ba + cb8d02c commit e116b54
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ type {{ .Resource.Kind }}Spec struct {
// Important: Run "make" to regenerate code after modifying this file
// Size defines the number of {{ .Resource.Kind }} instances
// The following markers will use OpenAPI v3 schema to validate the value
// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=3
// +kubebuilder:validation:ExclusiveMaximum=false
Size int32 ` + "`" + `json:"size,omitempty"` + "`" + `
{{ if not (isEmptyStr .Port) -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ type BusyboxSpec struct {
// Important: Run "make" to regenerate code after modifying this file

// Size defines the number of Busybox instances
// The following markers will use OpenAPI v3 schema to validate the value
// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=3
// +kubebuilder:validation:ExclusiveMaximum=false
Size int32 `json:"size,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ type MemcachedSpec struct {
// Important: Run "make" to regenerate code after modifying this file

// Size defines the number of Memcached instances
// The following markers will use OpenAPI v3 schema to validate the value
// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=3
// +kubebuilder:validation:ExclusiveMaximum=false
Size int32 `json:"size,omitempty"`

// Port defines the port that will be used to init the container with the image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ spec:
description: BusyboxSpec defines the desired state of Busybox
properties:
size:
description: Size defines the number of Busybox instances
description: 'Size defines the number of Busybox instances The following
markers will use OpenAPI v3 schema to validate the value More info:
https://book.kubebuilder.io/reference/markers/crd-validation.html'
format: int32
maximum: 3
minimum: 1
type: integer
type: object
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ spec:
format: int32
type: integer
size:
description: Size defines the number of Memcached instances
description: 'Size defines the number of Memcached instances The following
markers will use OpenAPI v3 schema to validate the value More info:
https://book.kubebuilder.io/reference/markers/crd-validation.html'
format: int32
maximum: 3
minimum: 1
type: integer
type: object
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ type BusyboxSpec struct {
// Important: Run "make" to regenerate code after modifying this file

// Size defines the number of Busybox instances
// The following markers will use OpenAPI v3 schema to validate the value
// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=3
// +kubebuilder:validation:ExclusiveMaximum=false
Size int32 `json:"size,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ type MemcachedSpec struct {
// Important: Run "make" to regenerate code after modifying this file

// Size defines the number of Memcached instances
// The following markers will use OpenAPI v3 schema to validate the value
// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=3
// +kubebuilder:validation:ExclusiveMaximum=false
Size int32 `json:"size,omitempty"`

// Port defines the port that will be used to init the container with the image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ spec:
description: BusyboxSpec defines the desired state of Busybox
properties:
size:
description: Size defines the number of Busybox instances
description: 'Size defines the number of Busybox instances The following
markers will use OpenAPI v3 schema to validate the value More info:
https://book.kubebuilder.io/reference/markers/crd-validation.html'
format: int32
maximum: 3
minimum: 1
type: integer
type: object
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ spec:
format: int32
type: integer
size:
description: Size defines the number of Memcached instances
description: 'Size defines the number of Memcached instances The following
markers will use OpenAPI v3 schema to validate the value More info:
https://book.kubebuilder.io/reference/markers/crd-validation.html'
format: int32
maximum: 3
minimum: 1
type: integer
type: object
status:
Expand Down

0 comments on commit e116b54

Please sign in to comment.