From 4d566f4a4d16c975919726b95a51c3be8729bf3e Mon Sep 17 00:00:00 2001 From: Jim Dickinson Date: Fri, 21 Aug 2020 17:10:29 -0400 Subject: [PATCH] DSE 6.8.2 support (#207) * Bumping examples and tests to 6.8.2 * Updating go code * Updating docs and config * Ran codegen --- buildsettings.yaml | 2 +- .../templates/customresourcedefinition.yaml | 1 + docs/user/README.md | 6 +++--- ...ndra.datastax.com_cassandradatacenters_crd.yaml | 1 + .../dse-6.8.x/example-cassdc-full.yaml | 2 +- .../dse-6.8.x/example-cassdc-minimal.yaml | 2 +- .../example-cassdc-three-rack-three-node.yaml | 2 +- .../cassandra/v1beta1/cassandradatacenter_types.go | 13 ++++++++++--- .../v1beta1/cassandradatacenter_types_test.go | 6 +++--- operator/pkg/apis/cassandra/v1beta1/webhook.go | 2 ++ .../pkg/apis/cassandra/v1beta1/webhook_test.go | 14 +++++++------- operator/pkg/reconciliation/testing.go | 2 +- .../additional-seeds-two-rack-four-node-dc.yaml | 2 +- tests/testdata/cluster-wide-install-dc1.yaml | 2 +- tests/testdata/cluster-wide-install-dc2.yaml | 2 +- ...ingle-rack-2-node-dc-with-superuser-secret.yaml | 2 +- tests/testdata/default-single-rack-2-node-dc.yaml | 2 +- .../default-single-rack-single-node-dc.yaml | 2 +- ...single-rack-single-node-extra-container-dc.yaml | 2 +- .../testdata/default-three-rack-three-node-dc.yaml | 2 +- tests/testdata/dse-one-node-dc-with-mtls.yaml | 2 +- tests/testdata/host-network-dc.yaml | 2 +- tests/testdata/nodeport-service-dc.yaml | 2 +- .../webhook_validation_suite_test.go | 2 +- 24 files changed, 44 insertions(+), 33 deletions(-) diff --git a/buildsettings.yaml b/buildsettings.yaml index 3f2ef7768..06c142041 100644 --- a/buildsettings.yaml +++ b/buildsettings.yaml @@ -17,6 +17,6 @@ jenkins: - simple-theme-plugin dev: images: - - datastax/dse-server:6.8.1 + - datastax/dse-server:6.8.2 - datastax/cass-config-builder:1.0.2 - datastax/cassandra-mgmtapi-3_11_6:v0.1.5 diff --git a/charts/cass-operator-chart/templates/customresourcedefinition.yaml b/charts/cass-operator-chart/templates/customresourcedefinition.yaml index 3ff023c00..e4ec402d5 100644 --- a/charts/cass-operator-chart/templates/customresourcedefinition.yaml +++ b/charts/cass-operator-chart/templates/customresourcedefinition.yaml @@ -6036,6 +6036,7 @@ spec: enum: - 6.8.0 - 6.8.1 + - 6.8.2 - 3.11.6 - 4.0.0 type: string diff --git a/docs/user/README.md b/docs/user/README.md index 6a529fe9d..7fa3d8e06 100644 --- a/docs/user/README.md +++ b/docs/user/README.md @@ -318,7 +318,7 @@ for your `CassandraDatacenter` resource, you can use the `serverType`, `serverVe spec properties. `serverType` is required and must be either `dse` or `cassandra`. `serverVersion` is also required, -and the supported versions for DSE are `6.8.0`/`6.8.1` and for Cassandra it is `3.11.6`. More versions +and the supported versions for DSE are `6.8.0` through `6.8.2`, and for Cassandra it is `3.11.6`. More versions will be supported in the future. If `serverImage` is not specified, a default image for the provided `serverType` and @@ -333,7 +333,7 @@ metadata: name: dtcntr spec: serverType: dse - serverVersion: 6.8.1 + serverVersion: 6.8.2 ``` @@ -359,7 +359,7 @@ metadata: name: dtcntr spec: serverType: dse - serverVersion: 6.8.1 + serverVersion: 6.8.2 serverImage: private-docker-registry.example.com/dse-img/dse:5f6e7d8c ``` diff --git a/operator/deploy/crds/cassandra.datastax.com_cassandradatacenters_crd.yaml b/operator/deploy/crds/cassandra.datastax.com_cassandradatacenters_crd.yaml index be07eef4e..784a90263 100644 --- a/operator/deploy/crds/cassandra.datastax.com_cassandradatacenters_crd.yaml +++ b/operator/deploy/crds/cassandra.datastax.com_cassandradatacenters_crd.yaml @@ -6026,6 +6026,7 @@ spec: enum: - 6.8.0 - 6.8.1 + - 6.8.2 - 3.11.6 - 4.0.0 type: string diff --git a/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-full.yaml b/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-full.yaml index 349584236..7e01cec5d 100644 --- a/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-full.yaml +++ b/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-full.yaml @@ -79,7 +79,7 @@ spec: serverType: "dse" # Which server version to use. Required. - serverVersion: "6.8.1" + serverVersion: "6.8.2" # Use the serverImage configuration to override Cass Operator's logic to map # the serverType plus serverVersion into a public container image on Docker diff --git a/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-minimal.yaml b/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-minimal.yaml index c5ec2a014..20a4e3ce6 100644 --- a/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-minimal.yaml +++ b/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-minimal.yaml @@ -7,7 +7,7 @@ metadata: spec: clusterName: cluster2 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 3 diff --git a/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-three-rack-three-node.yaml b/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-three-rack-three-node.yaml index a2da8e8bf..083c04db6 100644 --- a/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-three-rack-three-node.yaml +++ b/operator/example-cassdc-yaml/dse-6.8.x/example-cassdc-three-rack-three-node.yaml @@ -7,7 +7,7 @@ metadata: spec: clusterName: cluster2 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 3 diff --git a/operator/pkg/apis/cassandra/v1beta1/cassandradatacenter_types.go b/operator/pkg/apis/cassandra/v1beta1/cassandradatacenter_types.go index e203f0f72..0c388aba0 100644 --- a/operator/pkg/apis/cassandra/v1beta1/cassandradatacenter_types.go +++ b/operator/pkg/apis/cassandra/v1beta1/cassandradatacenter_types.go @@ -58,10 +58,13 @@ const ( ubi_cassandra_3_11_6 = "datastax/cassandra:3.11.6-ubi7" ubi_cassandra_4_0_0 = "datastax/cassandra:4.0-ubi7" - dse_6_8_0 = "datastax/dse-server:6.8.0" - dse_6_8_1 = "datastax/dse-server:6.8.1" + dse_6_8_0 = "datastax/dse-server:6.8.0" + dse_6_8_1 = "datastax/dse-server:6.8.1" + dse_6_8_2 = "datastax/dse-server:6.8.2" + ubi_dse_6_8_0 = "datastax/dse-server:6.8.0-ubi7" ubi_dse_6_8_1 = "datastax/dse-server:6.8.1-ubi7" + ubi_dse_6_8_2 = "datastax/dse-server:6.8.2-ubi7" EnvBaseImageOs = "BASE_IMAGE_OS" ) @@ -102,6 +105,8 @@ func getImageForDefaultBaseOs(sv string) (string, bool) { return dse_6_8_0, true case "dse-6.8.1": return dse_6_8_1, true + case "dse-6.8.2": + return dse_6_8_2, true case "cassandra-3.11.6": return cassandra_3_11_6, true case "cassandra-4.0.0": @@ -116,6 +121,8 @@ func getImageForUniversalBaseOs(sv string) (string, bool) { return ubi_dse_6_8_0, true case "dse-6.8.1": return ubi_dse_6_8_1, true + case "dse-6.8.2": + return ubi_dse_6_8_2, true case "cassandra-3.11.6": return ubi_cassandra_3_11_6, true case "cassandra-4.0.0": @@ -142,7 +149,7 @@ type CassandraDatacenterSpec struct { // Version string for config builder, // used to generate Cassandra server configuration - // +kubebuilder:validation:Enum="6.8.0";"6.8.1";"3.11.6";"4.0.0" + // +kubebuilder:validation:Enum="6.8.0";"6.8.1";"6.8.2";"3.11.6";"4.0.0" ServerVersion string `json:"serverVersion"` // Cassandra server image name. diff --git a/operator/pkg/apis/cassandra/v1beta1/cassandradatacenter_types_test.go b/operator/pkg/apis/cassandra/v1beta1/cassandradatacenter_types_test.go index 3ffd8daad..7b2938a52 100644 --- a/operator/pkg/apis/cassandra/v1beta1/cassandradatacenter_types_test.go +++ b/operator/pkg/apis/cassandra/v1beta1/cassandradatacenter_types_test.go @@ -65,13 +65,13 @@ func Test_makeImage(t *testing.T) { errString: "server 'dse' and version '6.7.0' do not work together", }, { - name: "test 6.8.1", + name: "test 6.8.2", args: args{ serverImage: "", serverType: "dse", - serverVersion: "6.8.1", + serverVersion: "6.8.2", }, - want: "datastax/dse-server:6.8.1", + want: "datastax/dse-server:6.8.2", errString: "", }, } diff --git a/operator/pkg/apis/cassandra/v1beta1/webhook.go b/operator/pkg/apis/cassandra/v1beta1/webhook.go index a30b5259c..817e9be95 100644 --- a/operator/pkg/apis/cassandra/v1beta1/webhook.go +++ b/operator/pkg/apis/cassandra/v1beta1/webhook.go @@ -38,6 +38,8 @@ func ValidateSingleDatacenter(dc CassandraDatacenter) error { err = nil case "6.8.1": err = nil + case "6.8.2": + err = nil default: err = attemptedTo("use unsupported DSE version '%s'", dc.Spec.ServerVersion) } diff --git a/operator/pkg/apis/cassandra/v1beta1/webhook_test.go b/operator/pkg/apis/cassandra/v1beta1/webhook_test.go index d13186ecc..4eaa677ba 100644 --- a/operator/pkg/apis/cassandra/v1beta1/webhook_test.go +++ b/operator/pkg/apis/cassandra/v1beta1/webhook_test.go @@ -34,14 +34,14 @@ func Test_ValidateSingleDatacenter(t *testing.T) { errString: "", }, { - name: "Dse 6.8.1 Valid", + name: "Dse 6.8.2 Valid", dc: &CassandraDatacenter{ ObjectMeta: metav1.ObjectMeta{ Name: "exampleDC", }, Spec: CassandraDatacenterSpec{ ServerType: "dse", - ServerVersion: "6.8.1", + ServerVersion: "6.8.2", }, }, errString: "", @@ -122,7 +122,7 @@ func Test_ValidateSingleDatacenter(t *testing.T) { }, Spec: CassandraDatacenterSpec{ ServerType: "dse", - ServerVersion: "6.8.1", + ServerVersion: "6.8.2", DseWorkloads: &DseWorkloads{ AnalyticsEnabled: true, }, @@ -180,7 +180,7 @@ func Test_ValidateSingleDatacenter(t *testing.T) { }, Spec: CassandraDatacenterSpec{ ServerType: "dse", - ServerVersion: "6.8.1", + ServerVersion: "6.8.2", Config: json.RawMessage(` { "cassandra-yaml": {}, @@ -191,7 +191,7 @@ func Test_ValidateSingleDatacenter(t *testing.T) { `), }, }, - errString: "attempted to define config jvm-options with dse-6.8.1", + errString: "attempted to define config jvm-options with dse-6.8.2", }, { name: "Allow multiple nodes per worker requires resource requests", @@ -201,7 +201,7 @@ func Test_ValidateSingleDatacenter(t *testing.T) { }, Spec: CassandraDatacenterSpec{ ServerType: "dse", - ServerVersion: "6.8.1", + ServerVersion: "6.8.2", Config: json.RawMessage(`{}`), AllowMultipleNodesPerWorker: true, Resources: corev1.ResourceRequirements{ @@ -226,7 +226,7 @@ func Test_ValidateSingleDatacenter(t *testing.T) { }, Spec: CassandraDatacenterSpec{ ServerType: "dse", - ServerVersion: "6.8.1", + ServerVersion: "6.8.2", Config: json.RawMessage(`{}`), AllowMultipleNodesPerWorker: true, }, diff --git a/operator/pkg/reconciliation/testing.go b/operator/pkg/reconciliation/testing.go index ae146cb66..1ef3c8241 100644 --- a/operator/pkg/reconciliation/testing.go +++ b/operator/pkg/reconciliation/testing.go @@ -83,7 +83,7 @@ func CreateMockReconciliationContext( Size: size, ClusterName: clusterName, ServerType: "dse", - ServerVersion: "6.8.1", + ServerVersion: "6.8.2", StorageConfig: storageConfig, }, } diff --git a/tests/testdata/additional-seeds-two-rack-four-node-dc.yaml b/tests/testdata/additional-seeds-two-rack-four-node-dc.yaml index 2bcd21e4b..d640226e6 100644 --- a/tests/testdata/additional-seeds-two-rack-four-node-dc.yaml +++ b/tests/testdata/additional-seeds-two-rack-four-node-dc.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster1 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 4 diff --git a/tests/testdata/cluster-wide-install-dc1.yaml b/tests/testdata/cluster-wide-install-dc1.yaml index ad8c40cb3..8c3161575 100644 --- a/tests/testdata/cluster-wide-install-dc1.yaml +++ b/tests/testdata/cluster-wide-install-dc1.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster1 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 1 diff --git a/tests/testdata/cluster-wide-install-dc2.yaml b/tests/testdata/cluster-wide-install-dc2.yaml index 64ebc7604..bd7232d98 100644 --- a/tests/testdata/cluster-wide-install-dc2.yaml +++ b/tests/testdata/cluster-wide-install-dc2.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster2 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 1 diff --git a/tests/testdata/default-single-rack-2-node-dc-with-superuser-secret.yaml b/tests/testdata/default-single-rack-2-node-dc-with-superuser-secret.yaml index fd4160e5c..50f950b21 100644 --- a/tests/testdata/default-single-rack-2-node-dc-with-superuser-secret.yaml +++ b/tests/testdata/default-single-rack-2-node-dc-with-superuser-secret.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster2 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 2 diff --git a/tests/testdata/default-single-rack-2-node-dc.yaml b/tests/testdata/default-single-rack-2-node-dc.yaml index e48fe37b3..98c9dd484 100644 --- a/tests/testdata/default-single-rack-2-node-dc.yaml +++ b/tests/testdata/default-single-rack-2-node-dc.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster2 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 2 diff --git a/tests/testdata/default-single-rack-single-node-dc.yaml b/tests/testdata/default-single-rack-single-node-dc.yaml index 64ebc7604..bd7232d98 100644 --- a/tests/testdata/default-single-rack-single-node-dc.yaml +++ b/tests/testdata/default-single-rack-single-node-dc.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster2 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 1 diff --git a/tests/testdata/default-single-rack-single-node-extra-container-dc.yaml b/tests/testdata/default-single-rack-single-node-extra-container-dc.yaml index 3720affa5..a0e660407 100644 --- a/tests/testdata/default-single-rack-single-node-extra-container-dc.yaml +++ b/tests/testdata/default-single-rack-single-node-extra-container-dc.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster2 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 1 diff --git a/tests/testdata/default-three-rack-three-node-dc.yaml b/tests/testdata/default-three-rack-three-node-dc.yaml index 3ca2c5b97..e0c952ebf 100644 --- a/tests/testdata/default-three-rack-three-node-dc.yaml +++ b/tests/testdata/default-three-rack-three-node-dc.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster1 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 3 diff --git a/tests/testdata/dse-one-node-dc-with-mtls.yaml b/tests/testdata/dse-one-node-dc-with-mtls.yaml index 85623692c..62fc4e16b 100644 --- a/tests/testdata/dse-one-node-dc-with-mtls.yaml +++ b/tests/testdata/dse-one-node-dc-with-mtls.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster1 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: manual: clientSecretName: mgmt-api-client-credentials diff --git a/tests/testdata/host-network-dc.yaml b/tests/testdata/host-network-dc.yaml index efc91e551..9cd551b1f 100644 --- a/tests/testdata/host-network-dc.yaml +++ b/tests/testdata/host-network-dc.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster1 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} size: 3 diff --git a/tests/testdata/nodeport-service-dc.yaml b/tests/testdata/nodeport-service-dc.yaml index 62ae57361..bcb9698e6 100644 --- a/tests/testdata/nodeport-service-dc.yaml +++ b/tests/testdata/nodeport-service-dc.yaml @@ -5,7 +5,7 @@ metadata: spec: clusterName: cluster1 serverType: dse - serverVersion: "6.8.1" + serverVersion: "6.8.2" managementApiAuth: insecure: {} networking: diff --git a/tests/webhook_validation/webhook_validation_suite_test.go b/tests/webhook_validation/webhook_validation_suite_test.go index dfeae0238..5fe537bf2 100644 --- a/tests/webhook_validation/webhook_validation_suite_test.go +++ b/tests/webhook_validation/webhook_validation_suite_test.go @@ -77,7 +77,7 @@ var _ = Describe(testName, func() { json = "{\"spec\": {\"serverType\": \"dse\", \"serverVersion\": \"4.8.0\"}}" k = kubectl.PatchMerge(dcResource, json) ns.ExecAndLogAndExpectErrorString(step, k, - `spec.serverVersion: Unsupported value: "4.8.0": supported values: "6.8.0", "6.8.1", "3.11.6", "4.0.0"`) + `spec.serverVersion: Unsupported value: "4.8.0": supported values: "6.8.0", "6.8.1", 6.8.2", "3.11.6", "4.0.0"`) step = "attempt to change the dc name" json = "{\"spec\": {\"clusterName\": \"NewName\"}}" k = kubectl.PatchMerge(dcResource, json)