From 750c565a607bbdb27e51132e8b1393e4500e0f6b Mon Sep 17 00:00:00 2001 From: Brendan Shephard Date: Mon, 7 Apr 2025 07:45:30 +1000 Subject: [PATCH] Use x-kuberentes-list-type=atomic for extraMounts Add anootation for ExtraMounts to set x-kubernetes-list-type Ref: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/ Signed-off-by: Brendan Shephard --- api/bases/keystone.openstack.org_keystoneapis.yaml | 1 + api/v1beta1/keystoneapi_types.go | 3 ++- config/crd/bases/keystone.openstack.org_keystoneapis.yaml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/bases/keystone.openstack.org_keystoneapis.yaml b/api/bases/keystone.openstack.org_keystoneapis.yaml index bf3eb1bb..7e725f5e 100644 --- a/api/bases/keystone.openstack.org_keystoneapis.yaml +++ b/api/bases/keystone.openstack.org_keystoneapis.yaml @@ -1154,6 +1154,7 @@ spec: - volumes type: object type: array + x-kubernetes-list-type: atomic name: type: string region: diff --git a/api/v1beta1/keystoneapi_types.go b/api/v1beta1/keystoneapi_types.go index ca0509eb..fd8b670b 100644 --- a/api/v1beta1/keystoneapi_types.go +++ b/api/v1beta1/keystoneapi_types.go @@ -26,9 +26,9 @@ import ( "github.com/openstack-k8s-operators/lib-common/modules/common/tls" "github.com/openstack-k8s-operators/lib-common/modules/common/util" "github.com/openstack-k8s-operators/lib-common/modules/storage" - "k8s.io/apimachinery/pkg/util/validation/field" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/validation/field" ) const ( @@ -347,6 +347,7 @@ type KeystoneExtraMounts struct { // +kubebuilder:validation:Optional Region string `json:"region,omitempty"` // +kubebuilder:validation:Required + // +listType=atomic VolMounts []storage.VolMounts `json:"extraVol"` } diff --git a/config/crd/bases/keystone.openstack.org_keystoneapis.yaml b/config/crd/bases/keystone.openstack.org_keystoneapis.yaml index bf3eb1bb..7e725f5e 100644 --- a/config/crd/bases/keystone.openstack.org_keystoneapis.yaml +++ b/config/crd/bases/keystone.openstack.org_keystoneapis.yaml @@ -1154,6 +1154,7 @@ spec: - volumes type: object type: array + x-kubernetes-list-type: atomic name: type: string region: