Skip to content

Commit

Permalink
Validate memcached replicas to be >= 1
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiccini committed Jul 30, 2024
1 parent 84df6df commit 0df5f68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apis/bases/memcached.openstack.org_memcacheds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ spec:
default: 1
description: Size of the memcached cluster
format: int32
maximum: 32
minimum: 1
type: integer
tls:
description: TLS settings for memcached service
Expand All @@ -66,6 +68,7 @@ spec:
type: object
required:
- containerImage
- replicas
type: object
status:
description: MemcachedStatus defines the observed state of Memcached
Expand Down
3 changes: 2 additions & 1 deletion apis/memcached/v1beta1/memcached_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ type MemcachedSpec struct {
// MemcachedSpecCore - this version is used by the OpenStackControlplane CR (no container images)
type MemcachedSpecCore struct {

// +kubebuilder:validation:Optional
// +kubebuilder:default=1
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=32
// Size of the memcached cluster
Replicas *int32 `json:"replicas"`

Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/memcached.openstack.org_memcacheds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ spec:
default: 1
description: Size of the memcached cluster
format: int32
maximum: 32
minimum: 1
type: integer
tls:
description: TLS settings for memcached service
Expand All @@ -66,6 +68,7 @@ spec:
type: object
required:
- containerImage
- replicas
type: object
status:
description: MemcachedStatus defines the observed state of Memcached
Expand Down

0 comments on commit 0df5f68

Please sign in to comment.