From 712a1a1683f0ae1ba211b656c97c4b7d3782c603 Mon Sep 17 00:00:00 2001 From: John Blackwell Date: Wed, 29 Jan 2025 17:18:54 -0500 Subject: [PATCH] Make clusterRefs mutable --- .../crds/deployments.plural.sh_servicedeployments.yaml | 3 --- go/controller/api/v1alpha1/servicedeployment_types.go | 4 ++-- .../crd/bases/deployments.plural.sh_servicedeployments.yaml | 3 --- go/controller/internal/test/mocks/ConsoleClient_mock.go | 2 +- .../crds/deployments.plural.sh_servicedeployments.yaml | 3 --- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/charts/controller/crds/deployments.plural.sh_servicedeployments.yaml b/charts/controller/crds/deployments.plural.sh_servicedeployments.yaml index 8076b07e10..d2b1992018 100644 --- a/charts/controller/crds/deployments.plural.sh_servicedeployments.yaml +++ b/charts/controller/crds/deployments.plural.sh_servicedeployments.yaml @@ -124,9 +124,6 @@ spec: type: string type: object x-kubernetes-map-type: atomic - x-kubernetes-validations: - - message: Cluster is immutable - rule: self == oldSelf configuration: additionalProperties: type: string diff --git a/go/controller/api/v1alpha1/servicedeployment_types.go b/go/controller/api/v1alpha1/servicedeployment_types.go index dcdcdf8606..e42a2ca10f 100644 --- a/go/controller/api/v1alpha1/servicedeployment_types.go +++ b/go/controller/api/v1alpha1/servicedeployment_types.go @@ -3,12 +3,13 @@ package v1alpha1 import ( "encoding/json" - console "github.com/pluralsh/console/go/client" "github.com/samber/lo" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + + console "github.com/pluralsh/console/go/client" ) func init() { @@ -159,7 +160,6 @@ type ServiceSpec struct { // +kubebuilder:validation:Optional RepositoryRef *corev1.ObjectReference `json:"repositoryRef"` // +kubebuilder:validation:Required - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Cluster is immutable" ClusterRef corev1.ObjectReference `json:"clusterRef"` // ConfigurationRef is a secret reference which should contain service configuration. // +kubebuilder:validation:Optional diff --git a/go/controller/config/crd/bases/deployments.plural.sh_servicedeployments.yaml b/go/controller/config/crd/bases/deployments.plural.sh_servicedeployments.yaml index 8076b07e10..d2b1992018 100644 --- a/go/controller/config/crd/bases/deployments.plural.sh_servicedeployments.yaml +++ b/go/controller/config/crd/bases/deployments.plural.sh_servicedeployments.yaml @@ -124,9 +124,6 @@ spec: type: string type: object x-kubernetes-map-type: atomic - x-kubernetes-validations: - - message: Cluster is immutable - rule: self == oldSelf configuration: additionalProperties: type: string diff --git a/go/controller/internal/test/mocks/ConsoleClient_mock.go b/go/controller/internal/test/mocks/ConsoleClient_mock.go index 7feb9f110a..d83fed6fdd 100644 --- a/go/controller/internal/test/mocks/ConsoleClient_mock.go +++ b/go/controller/internal/test/mocks/ConsoleClient_mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.45.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/plural/helm/console/crds/deployments.plural.sh_servicedeployments.yaml b/plural/helm/console/crds/deployments.plural.sh_servicedeployments.yaml index 8076b07e10..d2b1992018 100644 --- a/plural/helm/console/crds/deployments.plural.sh_servicedeployments.yaml +++ b/plural/helm/console/crds/deployments.plural.sh_servicedeployments.yaml @@ -124,9 +124,6 @@ spec: type: string type: object x-kubernetes-map-type: atomic - x-kubernetes-validations: - - message: Cluster is immutable - rule: self == oldSelf configuration: additionalProperties: type: string