Skip to content

Commit

Permalink
Fix mount path for config file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Jan 30, 2023
1 parent f173cd6 commit 38b4167
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion controllers/k8ssandra/cassandra_metrics_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package k8ssandra

import (
"context"
"testing"

"github.com/k8ssandra/k8ssandra-operator/pkg/cassandra"
"github.com/stretchr/testify/assert"
"testing"

cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1"
api "github.com/k8ssandra/k8ssandra-operator/apis/k8ssandra/v1alpha1"
Expand Down
3 changes: 2 additions & 1 deletion pkg/telemetry/cassandra_agent/cassandra_agent_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ func (c Configurator) AddStsVolumes(dc *cassdcapi.CassandraDatacenter) error {
func(c *corev1.Container) {
vm := corev1.VolumeMount{
Name: "metrics-agent-config",
MountPath: filepath.Base(filepath.Dir(agentConfigLocation)),
MountPath: agentConfigLocation,
SubPath: filepath.Base(agentConfigLocation),
}
c.VolumeMounts = append(c.VolumeMounts, vm)
})
Expand Down
3 changes: 2 additions & 1 deletion pkg/telemetry/cassandra_agent/cassandra_agent_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ func Test_AddStsVolumes(t *testing.T) {
}
expectedVm := corev1.VolumeMount{
Name: "metrics-agent-config",
MountPath: filepath.Base(filepath.Dir(agentConfigLocation)),
MountPath: agentConfigLocation,
SubPath: filepath.Base(agentConfigLocation),
}
assert.Contains(t, dc.Spec.PodTemplateSpec.Spec.Containers[cassContainer].VolumeMounts, expectedVm)
}
Expand Down

0 comments on commit 38b4167

Please sign in to comment.