Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func Test_makeImage(t *testing.T) {
serverType: "cassandra",
serverVersion: "3.11.7",
},
want: "datastax/cassandra-mgmtapi-3_11_7:v0.1.13",
want: "datastax/cassandra-mgmtapi-3_11_7:v0.1.22",
errString: "",
},
{
Expand Down
4 changes: 2 additions & 2 deletions operator/pkg/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const (
var imageLookupMap map[Image]string = map[Image]string{

Cassandra_3_11_6: "datastax/cassandra-mgmtapi-3_11_6:v0.1.5",
Cassandra_3_11_7: "datastax/cassandra-mgmtapi-3_11_7:v0.1.13",
Cassandra_3_11_7: "datastax/cassandra-mgmtapi-3_11_7:v0.1.22",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @zencircle.

The v0.1.22 image is configured to run Cassandra as non-root whereas the v0.1.13 image is configured to run as root. While running as non-root is definitely a good change, switching the default image in this way probably merits some discussion.

Copy link

@emerkle826 emerkle826 Mar 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zencircle, John is right. You will likely run into problems with this bit of code:

https://github.com/zencircle/cass-operator/blob/patch-1/operator/pkg/images/images.go#L168-L179

as it will assume that the default 3.11.7 image is run as root. The version you are upgrading too does not run as root as John said.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zencircle
You likely have to remove "3.11.7" from this line:
https://github.com/zencircle/cass-operator/blob/patch-1/operator/pkg/images/images.go#L172

and change the line in the test that expects it to be run as root (from false to true) here:
https://github.com/zencircle/cass-operator/blob/patch-1/operator/pkg/images/images_test.go#L70

Cassandra_4_0_0: "datastax/cassandra-mgmtapi-4_0_0:v0.1.12",

UBICassandra_3_11_6: "datastax/cassandra:3.11.6-ubi7",
Expand Down Expand Up @@ -169,7 +169,7 @@ func applyDefaultRegistryOverride(image string) string {
// This is meant to be used when the CassandraDatacenter does not
// explicitly set the DockerImageRunsAsCassandra field.
func CalculateDockerImageRunsAsCassandra(version string) bool {
if version == "3.11.6" || version == "3.11.7" || version == "4.0.0" {
if version == "3.11.6" || version == "4.0.0" {
return false
}

Expand Down
2 changes: 1 addition & 1 deletion operator/pkg/images/images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func Test_CalculateDockerImageRunsAsCassandra(t *testing.T) {
},
{
version: "3.11.7",
want: false,
want: true,
},
{
version: "4.0.0",
Expand Down