diff --git a/CHANGELOG/CHANGELOG-1.15.md b/CHANGELOG/CHANGELOG-1.15.md index 3bb32cf54..218cedbe1 100644 --- a/CHANGELOG/CHANGELOG-1.15.md +++ b/CHANGELOG/CHANGELOG-1.15.md @@ -19,4 +19,5 @@ When cutting a new release, update the `unreleased` heading to the tag being gen * [BUGFIX] [#1253](https://github.com/k8ssandra/k8ssandra-operator/issues/1253) Medusa storage secrets are now labelled with a unique label. * [FEATURE] [#1260](https://github.com/k8ssandra/k8ssandra-operator/issues/1260) Update controller-gen to version 0.14.0. * [BUGFIX] [1287](https://github.com/k8ssandra/k8ssandra-operator/pull/1287) Use the same image for Reaper init and main containers -* [ENHANCEMENT] [1288](https://github.com/k8ssandra/k8ssandra-operator/issues/1288) Allow disabling the CRD upgrader \ No newline at end of file +* [ENHANCEMENT] [1288](https://github.com/k8ssandra/k8ssandra-operator/issues/1288) Allow disabling the CRD upgrader +* [CHANGE] Upgrade Reaper to v3.6.0 \ No newline at end of file diff --git a/apis/reaper/v1alpha1/reaper_types.go b/apis/reaper/v1alpha1/reaper_types.go index 04f5b00ed..41105dc3e 100644 --- a/apis/reaper/v1alpha1/reaper_types.go +++ b/apis/reaper/v1alpha1/reaper_types.go @@ -67,17 +67,14 @@ type ReaperTemplate struct { SecretsProvider string `json:"secretsProvider,omitempty"` // The image to use for the Reaper pod main container. - // The default is "thelastpickle/cassandra-reaper:3.5.0". + // The default is "thelastpickle/cassandra-reaper:3.6.0". // +optional // TODO: update with real release version. - // +kubebuilder:default={repository:"thelastpickle",name:"cassandra-reaper",tag:"3.5.0"} + // +kubebuilder:default={repository:"thelastpickle",name:"cassandra-reaper",tag:"3.6.0"} ContainerImage *images.Image `json:"containerImage,omitempty"` - // The image to use for the Reaper pod init container (that performs schema migrations). - // The default is "thelastpickle/cassandra-reaper:3.5.0". + // Deprecated: The main container image will be used for the init container as well. // +optional - // TODO: update with real release version. - // +kubebuilder:default={repository:"thelastpickle",name:"cassandra-reaper",tag:"3.5.0"} InitContainerImage *images.Image `json:"initContainerImage,omitempty"` // +kubebuilder:default="default" diff --git a/charts/k8ssandra-operator/crds/k8ssandra-operator-crds.yaml b/charts/k8ssandra-operator/crds/k8ssandra-operator-crds.yaml index cbb79f047..599955f17 100644 --- a/charts/k8ssandra-operator/crds/k8ssandra-operator-crds.yaml +++ b/charts/k8ssandra-operator/crds/k8ssandra-operator-crds.yaml @@ -26236,10 +26236,10 @@ spec: default: name: cassandra-reaper repository: thelastpickle - tag: 3.5.0 + tag: 3.6.0 description: |- The image to use for the Reaper pod main container. - The default is "thelastpickle/cassandra-reaper:3.5.0". + The default is "thelastpickle/cassandra-reaper:3.6.0". TODO: update with real release version. properties: name: @@ -26320,14 +26320,8 @@ spec: x-kubernetes-map-type: atomic type: object initContainerImage: - default: - name: cassandra-reaper - repository: thelastpickle - tag: 3.5.0 - description: |- - The image to use for the Reaper pod init container (that performs schema migrations). - The default is "thelastpickle/cassandra-reaper:3.5.0". - TODO: update with real release version. + description: 'Deprecated: The main container image will be used + for the init container as well.' properties: name: description: The image name to use. @@ -31837,10 +31831,10 @@ spec: default: name: cassandra-reaper repository: thelastpickle - tag: 3.5.0 + tag: 3.6.0 description: |- The image to use for the Reaper pod main container. - The default is "thelastpickle/cassandra-reaper:3.5.0". + The default is "thelastpickle/cassandra-reaper:3.6.0". TODO: update with real release version. properties: name: @@ -31945,14 +31939,8 @@ spec: x-kubernetes-map-type: atomic type: object initContainerImage: - default: - name: cassandra-reaper - repository: thelastpickle - tag: 3.5.0 - description: |- - The image to use for the Reaper pod init container (that performs schema migrations). - The default is "thelastpickle/cassandra-reaper:3.5.0". - TODO: update with real release version. + description: 'Deprecated: The main container image will be used for + the init container as well.' properties: name: description: The image name to use. diff --git a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml index 61cb3e793..d22595b54 100644 --- a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml +++ b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml @@ -26174,10 +26174,10 @@ spec: default: name: cassandra-reaper repository: thelastpickle - tag: 3.5.0 + tag: 3.6.0 description: |- The image to use for the Reaper pod main container. - The default is "thelastpickle/cassandra-reaper:3.5.0". + The default is "thelastpickle/cassandra-reaper:3.6.0". TODO: update with real release version. properties: name: @@ -26258,14 +26258,8 @@ spec: x-kubernetes-map-type: atomic type: object initContainerImage: - default: - name: cassandra-reaper - repository: thelastpickle - tag: 3.5.0 - description: |- - The image to use for the Reaper pod init container (that performs schema migrations). - The default is "thelastpickle/cassandra-reaper:3.5.0". - TODO: update with real release version. + description: 'Deprecated: The main container image will be used + for the init container as well.' properties: name: description: The image name to use. diff --git a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml index a5c45931f..9523a9dad 100644 --- a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml +++ b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml @@ -986,10 +986,10 @@ spec: default: name: cassandra-reaper repository: thelastpickle - tag: 3.5.0 + tag: 3.6.0 description: |- The image to use for the Reaper pod main container. - The default is "thelastpickle/cassandra-reaper:3.5.0". + The default is "thelastpickle/cassandra-reaper:3.6.0". TODO: update with real release version. properties: name: @@ -1094,14 +1094,8 @@ spec: x-kubernetes-map-type: atomic type: object initContainerImage: - default: - name: cassandra-reaper - repository: thelastpickle - tag: 3.5.0 - description: |- - The image to use for the Reaper pod init container (that performs schema migrations). - The default is "thelastpickle/cassandra-reaper:3.5.0". - TODO: update with real release version. + description: 'Deprecated: The main container image will be used for + the init container as well.' properties: name: description: The image name to use. diff --git a/pkg/reaper/deployment.go b/pkg/reaper/deployment.go index 7fce8dcdc..54e371649 100644 --- a/pkg/reaper/deployment.go +++ b/pkg/reaper/deployment.go @@ -24,7 +24,7 @@ import ( const ( DefaultImageRepository = "thelastpickle" DefaultImageName = "cassandra-reaper" - DefaultVersion = "3.5.0" + DefaultVersion = "3.6.0" // When changing the default version above, please also change the kubebuilder markers in // apis/reaper/v1alpha1/reaper_types.go accordingly. diff --git a/pkg/reaper/deployment_test.go b/pkg/reaper/deployment_test.go index e059e8d00..656fe0053 100644 --- a/pkg/reaper/deployment_test.go +++ b/pkg/reaper/deployment_test.go @@ -21,10 +21,8 @@ import ( func TestNewDeployment(t *testing.T) { mainImage := &images.Image{Repository: "test", Name: "reaper", Tag: "latest", PullPolicy: corev1.PullAlways} - initImage := &images.Image{Repository: "test", Name: "reaper-init", Tag: "1.2.3", PullPolicy: corev1.PullNever} reaper := newTestReaper() reaper.Spec.ContainerImage = mainImage - reaper.Spec.InitContainerImage = initImage reaper.Spec.AutoScheduling = reaperapi.AutoScheduling{Enabled: false} reaper.Spec.ServiceAccountName = "reaper" reaper.Spec.DatacenterAvailability = DatacenterAvailabilityAll @@ -126,8 +124,8 @@ func TestNewDeployment(t *testing.T) { assert.Len(t, podSpec.InitContainers, 1) initContainer := podSpec.InitContainers[0] - assert.Equal(t, "docker.io/test/reaper-init:1.2.3", initContainer.Image) - assert.Equal(t, corev1.PullNever, initContainer.ImagePullPolicy) + assert.Equal(t, "docker.io/test/reaper:latest", initContainer.Image) + assert.Equal(t, corev1.PullAlways, initContainer.ImagePullPolicy) assert.ElementsMatch(t, initContainer.Env, []corev1.EnvVar{ { Name: "REAPER_STORAGE_TYPE", @@ -342,28 +340,22 @@ func TestImages(t *testing.T) { // Note: nil images are normally not possible due to the kubebuilder markers on the CRD spec t.Run("nil images", func(t *testing.T) { reaper := newTestReaper() - reaper.Spec.InitContainerImage = nil reaper.Spec.ContainerImage = nil logger := testlogr.NewTestLogger(t) deployment := NewDeployment(reaper, newTestDatacenter(), nil, nil, logger) - assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.5.0", deployment.Spec.Template.Spec.InitContainers[0].Image) - assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.5.0", deployment.Spec.Template.Spec.Containers[0].Image) + assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.6.0", deployment.Spec.Template.Spec.InitContainers[0].Image) + assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.6.0", deployment.Spec.Template.Spec.Containers[0].Image) assert.Equal(t, corev1.PullIfNotPresent, deployment.Spec.Template.Spec.InitContainers[0].ImagePullPolicy) assert.Equal(t, corev1.PullIfNotPresent, deployment.Spec.Template.Spec.Containers[0].ImagePullPolicy) assert.Empty(t, deployment.Spec.Template.Spec.ImagePullSecrets) }) t.Run("default images", func(t *testing.T) { reaper := newTestReaper() - reaper.Spec.InitContainerImage = &images.Image{ - Repository: "thelastpickle", - Name: "cassandra-reaper", - Tag: DefaultVersion, - } reaper.Spec.ContainerImage = nil logger := testlogr.NewTestLogger(t) deployment := NewDeployment(reaper, newTestDatacenter(), nil, nil, logger) - assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.5.0", deployment.Spec.Template.Spec.InitContainers[0].Image) - assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.5.0", deployment.Spec.Template.Spec.Containers[0].Image) + assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.6.0", deployment.Spec.Template.Spec.InitContainers[0].Image) + assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.6.0", deployment.Spec.Template.Spec.Containers[0].Image) assert.Equal(t, corev1.PullIfNotPresent, deployment.Spec.Template.Spec.InitContainers[0].ImagePullPolicy) assert.Equal(t, corev1.PullIfNotPresent, deployment.Spec.Template.Spec.Containers[0].ImagePullPolicy) assert.Empty(t, deployment.Spec.Template.Spec.ImagePullSecrets) @@ -376,7 +368,6 @@ func TestImages(t *testing.T) { Tag: "latest", PullSecretRef: &corev1.LocalObjectReference{Name: "my-secret"}, } - reaper.Spec.InitContainerImage = image reaper.Spec.ContainerImage = image logger := testlogr.NewTestLogger(t) deployment := NewDeployment(reaper, newTestDatacenter(), nil, nil, logger)