From 8ba57036e9f0f96292ce847c61ca3996f3fbafba Mon Sep 17 00:00:00 2001 From: Olivier Michallat Date: Thu, 28 Mar 2024 17:55:25 -0700 Subject: [PATCH] Sanitize DC name in pods selector (fixes #1252) (#1257) --- CHANGELOG/CHANGELOG-1.14.md | 1 + charts/k8ssandra-operator/Chart.yaml | 2 +- config/cass-operator/cluster-scoped/kustomization.yaml | 4 ++-- config/cass-operator/ns-scoped/kustomization.yaml | 4 ++-- .../components/cass-operator-image-config/image_config.yaml | 2 +- go.mod | 2 +- go.sum | 4 ++-- pkg/cassandra/management.go | 4 +++- pkg/test/testenv.go | 2 +- test/e2e/suite_test.go | 4 ++-- test/kuttl/test-servicemonitors/03-assert.yaml | 2 +- 11 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG/CHANGELOG-1.14.md b/CHANGELOG/CHANGELOG-1.14.md index 41cd95db0..4f2cf22cb 100644 --- a/CHANGELOG/CHANGELOG-1.14.md +++ b/CHANGELOG/CHANGELOG-1.14.md @@ -18,3 +18,4 @@ When cutting a new release, update the `unreleased` heading to the tag being gen * [BUGFIX] [#1226](https://github.com/k8ssandra/k8ssandra-operator/issues/1226) Medusa purge cronjob should be created in the operator namespace * [BUGFIX] [#1141](https://github.com/k8ssandra/k8ssandra-operator/issues/1141) Use DC name override when naming secondary resources * [BUGFIX] [#1138](https://github.com/k8ssandra/k8ssandra-operator/issues/1138) Use cluster name override for metrics agent ConfigMap +* [BUGFIX] [#1252](https://github.com/k8ssandra/k8ssandra-operator/issues/1252) Sanitize DC name in pods selector diff --git a/charts/k8ssandra-operator/Chart.yaml b/charts/k8ssandra-operator/Chart.yaml index dcd737f3a..53fbefc5c 100644 --- a/charts/k8ssandra-operator/Chart.yaml +++ b/charts/k8ssandra-operator/Chart.yaml @@ -9,7 +9,7 @@ dependencies: version: 0.29.0 repository: https://helm.k8ssandra.io - name: cass-operator - version: 0.47.0 + version: 0.47.1 repository: https://helm.k8ssandra.io home: https://github.com/k8ssandra/k8ssandra-operator sources: diff --git a/config/cass-operator/cluster-scoped/kustomization.yaml b/config/cass-operator/cluster-scoped/kustomization.yaml index 1a1390328..b80f83aa7 100644 --- a/config/cass-operator/cluster-scoped/kustomization.yaml +++ b/config/cass-operator/cluster-scoped/kustomization.yaml @@ -2,10 +2,10 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- github.com/k8ssandra/cass-operator/config/deployments/cluster?ref=master +- github.com/k8ssandra/cass-operator/config/deployments/cluster?ref=v1.19.1 components: - ../../components/cass-operator-image-config images: - name: k8ssandra/cass-operator - newTag: v1.19.0-dev.ff5bc87-20240111 + newTag: v1.19.1 diff --git a/config/cass-operator/ns-scoped/kustomization.yaml b/config/cass-operator/ns-scoped/kustomization.yaml index ee808c453..620ab4ec8 100644 --- a/config/cass-operator/ns-scoped/kustomization.yaml +++ b/config/cass-operator/ns-scoped/kustomization.yaml @@ -2,11 +2,11 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- github.com/k8ssandra/cass-operator/config/deployments/default?ref=master +- github.com/k8ssandra/cass-operator/config/deployments/default?ref=v1.19.1 components: - ../../components/cass-operator-image-config images: - name: k8ssandra/cass-operator - newTag: v1.19.0-dev.ff5bc87-20240111 + newTag: v1.19.1 diff --git a/config/components/cass-operator-image-config/image_config.yaml b/config/components/cass-operator-image-config/image_config.yaml index b1c22472e..2a820aeb9 100644 --- a/config/components/cass-operator-image-config/image_config.yaml +++ b/config/components/cass-operator-image-config/image_config.yaml @@ -3,7 +3,7 @@ kind: ImageConfig metadata: name: image-config images: - system-logger: "k8ssandra/system-logger:v1.18.2" + system-logger: "k8ssandra/system-logger:v1.19.1" config-builder: "datastax/cass-config-builder:1.0.7" k8ssandra-client: "k8ssandra/k8ssandra-client:v0.2.2" # cassandra: diff --git a/go.mod b/go.mod index 7339bfa74..b3f87384e 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/go-logr/zapr v1.2.3 github.com/google/uuid v1.3.0 github.com/gruntwork-io/terratest v0.37.7 - github.com/k8ssandra/cass-operator v1.19.0 + github.com/k8ssandra/cass-operator v1.19.1 github.com/k8ssandra/reaper-client-go v0.3.1-0.20220114183114-6923e077c4f5 github.com/pkg/errors v0.9.1 github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.52.1 diff --git a/go.sum b/go.sum index 689d08ef1..2fd149ea2 100644 --- a/go.sum +++ b/go.sum @@ -653,8 +653,8 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/k8ssandra/cass-operator v1.19.0 h1:k+/IdbAowA8J5pV/YNy5mCqTn+I0ultdEJJYNSMP6NE= -github.com/k8ssandra/cass-operator v1.19.0/go.mod h1:T25Qz8sj/R5JrjG9Wpo3/83o5MEw4pb/c8eiGqdnVcI= +github.com/k8ssandra/cass-operator v1.19.1 h1:MSNgOIVBpt2948S0SITF1rgnGsNG5j2gkixM/UXKPt8= +github.com/k8ssandra/cass-operator v1.19.1/go.mod h1:T25Qz8sj/R5JrjG9Wpo3/83o5MEw4pb/c8eiGqdnVcI= github.com/k8ssandra/reaper-client-go v0.3.1-0.20220114183114-6923e077c4f5 h1:Dq0VdM960G3AbhYwFuaebmsE08IzOYHYhngUfDmWaAc= github.com/k8ssandra/reaper-client-go v0.3.1-0.20220114183114-6923e077c4f5/go.mod h1:WsQymIaVT39xbcstZhdqynUS13AGzP2p6U9Hsk1oy5M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= diff --git a/pkg/cassandra/management.go b/pkg/cassandra/management.go index b283fd331..7a76d6a1a 100644 --- a/pkg/cassandra/management.go +++ b/pkg/cassandra/management.go @@ -134,7 +134,9 @@ func (r *defaultManagementApiFacade) CreateKeyspaceIfNotExists( func (r *defaultManagementApiFacade) fetchDatacenterPods() ([]corev1.Pod, error) { podList := &corev1.PodList{} - labels := client.MatchingLabels{cassdcapi.DatacenterLabel: r.dc.DatacenterName(), cassdcapi.ClusterLabel: cassdcapi.CleanLabelValue(r.dc.Spec.ClusterName)} + labels := client.MatchingLabels{ + cassdcapi.DatacenterLabel: cassdcapi.CleanLabelValue(r.dc.DatacenterName()), + cassdcapi.ClusterLabel: cassdcapi.CleanLabelValue(r.dc.Spec.ClusterName)} if err := r.k8sClient.List(r.ctx, podList, labels); err != nil { return nil, err } else { diff --git a/pkg/test/testenv.go b/pkg/test/testenv.go index 27b093fd0..7936c5ffb 100644 --- a/pkg/test/testenv.go +++ b/pkg/test/testenv.go @@ -45,7 +45,7 @@ import ( const ( clustersToCreate = 3 clusterProtoName = "cluster-%d-%s" - cassOperatorVersion = "v1.18.2" + cassOperatorVersion = "v1.19.1" prometheusOperatorVersion = "v0.9.0" ) diff --git a/test/e2e/suite_test.go b/test/e2e/suite_test.go index 7c4c941f6..d98a8206d 100644 --- a/test/e2e/suite_test.go +++ b/test/e2e/suite_test.go @@ -709,8 +709,8 @@ func applyPollingDefaults() { polling.reaperReady.timeout = 10 * time.Minute polling.reaperReady.interval = 15 * time.Second - polling.medusaBackupDone.timeout = 5 * time.Minute - polling.medusaBackupDone.interval = 5 * time.Second + polling.medusaBackupDone.timeout = 10 * time.Minute + polling.medusaBackupDone.interval = 15 * time.Second polling.medusaRestoreDone.timeout = 10 * time.Minute polling.medusaRestoreDone.interval = 15 * time.Second diff --git a/test/kuttl/test-servicemonitors/03-assert.yaml b/test/kuttl/test-servicemonitors/03-assert.yaml index d135259d5..e30bed93c 100644 --- a/test/kuttl/test-servicemonitors/03-assert.yaml +++ b/test/kuttl/test-servicemonitors/03-assert.yaml @@ -33,7 +33,7 @@ spec: - name: DSE_MGMT_EXPLICIT_START value: "true" name: cassandra - - image: k8ssandra/system-logger:v1.18.2 + - image: k8ssandra/system-logger:v1.19.1 name: server-system-logger status: readyReplicas: 1