Skip to content

Commit

Permalink
Address Michael's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
adejanovski committed Oct 2, 2023
1 parent faa5948 commit 7e210b0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/manager/image_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ImageConfig
metadata:
name: image-config
images:
system-logger: "k8ssandra/system-logger:v1.18.0-dev.30764ce-20231002"
system-logger: "k8ssandra/system-logger:latest"
config-builder: "datastax/cass-config-builder:1.0-ubi7"
k8ssandra-client: "k8ssandra/k8ssandra-client:v0.2.0"
# cassandra:
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ kind: Kustomization
images:
- name: controller
newName: k8ssandra/cass-operator
newTag: v1.18.0-dev.30764ce-20231002
newTag: latest
2 changes: 1 addition & 1 deletion pkg/reconciliation/construct_podtemplatespec.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ func buildContainers(dc *api.CassandraDatacenter, baseTemplate *corev1.PodTempla
{Name: "CLUSTER_NAME", Value: dc.Spec.ClusterName},
{Name: "DATACENTER_NAME", Value: dc.DatacenterName()},
{Name: "RACK_NAME", ValueFrom: selectorFromFieldPath("metadata.labels['cassandra.datastax.com/rack']")},
{Name: "NAMESPACE", Value: dc.Namespace},
{Name: "NAMESPACE", ValueFrom: selectorFromFieldPath("metadata.namespace")},
}

loggerContainer.Env = combineEnvSlices(loggerEnvDefaults, loggerContainer.Env)
Expand Down
3 changes: 2 additions & 1 deletion pkg/reconciliation/construct_podtemplatespec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ func TestLoggerContainerEnvVars(t *testing.T) {
podNameEnvVar := corev1.EnvVar{Name: "POD_NAME", ValueFrom: selectorFromFieldPath("metadata.name")}
nodeNameEnvVar := corev1.EnvVar{Name: "NODE_NAME", ValueFrom: selectorFromFieldPath("spec.nodeName")}
rackNameEnvVar := corev1.EnvVar{Name: "RACK_NAME", ValueFrom: selectorFromFieldPath("metadata.labels['cassandra.datastax.com/rack']")}
namespaceEnvVar := corev1.EnvVar{Name: "NAMESPACE", ValueFrom: selectorFromFieldPath("metadata.namespace")}

templateSpec := &corev1.PodTemplateSpec{}
dc := &api.CassandraDatacenter{
Expand All @@ -487,9 +488,9 @@ func TestLoggerContainerEnvVars(t *testing.T) {
assert.True(envVarsContains(loggerContainer.Env, podNameEnvVar))
assert.True(envVarsContains(loggerContainer.Env, nodeNameEnvVar))
assert.True(envVarsContains(loggerContainer.Env, rackNameEnvVar))
assert.True(envVarsContains(loggerContainer.Env, namespaceEnvVar))
assert.True(envVarsContains(loggerContainer.Env, corev1.EnvVar{Name: "CLUSTER_NAME", Value: dc.Spec.ClusterName}))
assert.True(envVarsContains(loggerContainer.Env, corev1.EnvVar{Name: "DATACENTER_NAME", Value: dc.DatacenterName()}))
assert.True(envVarsContains(loggerContainer.Env, corev1.EnvVar{Name: "NAMESPACE", Value: dc.Namespace}))
}

func TestCassandraDatacenter_buildContainers_override_other_containers(t *testing.T) {
Expand Down

0 comments on commit 7e210b0

Please sign in to comment.