Skip to content

Commit

Permalink
Merge branch '1.22.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
burmanm committed Sep 11, 2024
2 parents cc63a41 + d4e71c3 commit 454935b
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/kindIntegTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,6 @@ jobs:
#- config_fql # OSS only
- decommission_dc
# - stop_resume_scale_up # Odd insufficient CPU issues in kind+GHA
include:
- version: 4.1.5
serverImage: michaelburman290/cass-management-api:4.1.5-ubi8 # Modified version of cass-management-api
serverType: cassandra
integration_test: "smoke_test_read_only_fs"

# let other tests continue to run
# even if one fails
fail-fast: false
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Changelog for Cass Operator, new PRs should update the `main / unreleased` secti

## unreleased

* [FEATURE] [#651](https://github.com/k8ssandra/cass-operator/issues/651) Add tsreload task for DSE deployments and ability to check if sync operation is available on the mgmt-api side
* [BUGFIX] [#703](https://github.com/k8ssandra/cass-operator/issues/703) Fix HCD config path from /etc/cassandra to /opt/hcd/resources/cassandra/conf

## v1.22.1

* [BUGFIX] [#687](https://github.com/k8ssandra/cass-operator/issues/687) Prevent a crash when when StorageClassName was not set in the CassandraDataVolumeClaimSpec
Expand Down
16 changes: 12 additions & 4 deletions pkg/reconciliation/construct_podtemplatespec.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,10 +742,18 @@ func buildContainers(dc *api.CassandraDatacenter, baseTemplate *corev1.PodTempla
Name: "tmp",
MountPath: "/tmp",
})
cassContainer.VolumeMounts = append(cassContainer.VolumeMounts, corev1.VolumeMount{
Name: "etc-cassandra",
MountPath: "/etc/cassandra",
})

if dc.Spec.ServerType == "hcd" {
cassContainer.VolumeMounts = append(cassContainer.VolumeMounts, corev1.VolumeMount{
Name: "etc-cassandra",
MountPath: "/opt/hcd/resources/cassandra/conf",
})
} else {
cassContainer.VolumeMounts = append(cassContainer.VolumeMounts, corev1.VolumeMount{
Name: "etc-cassandra",
MountPath: "/etc/cassandra",
})
}
}

volumeMounts = combineVolumeMountSlices(volumeMounts, cassContainer.VolumeMounts)
Expand Down
56 changes: 56 additions & 0 deletions pkg/reconciliation/construct_podtemplatespec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2006,3 +2006,59 @@ func TestReadOnlyRootFilesystemVolumeChanges(t *testing.T) {
mcacDisabled := corev1.EnvVar{Name: "MGMT_API_DISABLE_MCAC", Value: "true"}
assert.True(envVarsContains(containers[0].Env, mcacDisabled))
}

func TestReadOnlyRootFilesystemVolumeChangesHCD(t *testing.T) {
assert := assert.New(t)
dc := &api.CassandraDatacenter{
Spec: api.CassandraDatacenterSpec{
ClusterName: "bob",
ServerType: "hcd",
ServerVersion: "1.0.0",
ReadOnlyRootFilesystem: ptr.To[bool](true),
Racks: []api.Rack{
{
Name: "r1",
},
},
},
}

podTemplateSpec, err := buildPodTemplateSpec(dc, dc.Spec.Racks[0], false)
assert.NoError(err, "failed to build PodTemplateSpec")

containers := podTemplateSpec.Spec.Containers
assert.NotNil(containers, "Unexpected containers containers received")
assert.NoError(err, "Unexpected error encountered")

assert.Len(containers, 2, "Unexpected number of containers containers returned")
assert.Equal("cassandra", containers[0].Name)
assert.Equal(ptr.To[bool](true), containers[0].SecurityContext.ReadOnlyRootFilesystem)

assert.True(reflect.DeepEqual(containers[0].VolumeMounts,
[]corev1.VolumeMount{
{
Name: "tmp",
MountPath: "/tmp",
},
{
Name: "etc-cassandra",
MountPath: "/opt/hcd/resources/cassandra/conf",
},
{
Name: "server-logs",
MountPath: "/var/log/cassandra",
},
{
Name: "server-data",
MountPath: "/var/lib/cassandra",
},
{
Name: "server-config",
MountPath: "/config",
},
}), fmt.Sprintf("Unexpected volume mounts for the cassandra container: %v", containers[0].VolumeMounts))

// TODO Verify MCAC is disabled since it will fail with ReadOnlyRootFilesystem
mcacDisabled := corev1.EnvVar{Name: "MGMT_API_DISABLE_MCAC", Value: "true"}
assert.True(envVarsContains(containers[0].Env, mcacDisabled))
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ metadata:
spec:
clusterName: cluster1
serverType: cassandra
serverVersion: "4.1.5"
serverImage: michaelburman290/cass-management-api:4.1.5-ubi8
serverVersion: 4.1.6
managementApiAuth:
insecure: {}
readOnlyRootFilesystem: true
Expand Down

0 comments on commit 454935b

Please sign in to comment.