diff --git a/controllers/humiocluster_pods.go b/controllers/humiocluster_pods.go index 9519cac8..82fd562e 100644 --- a/controllers/humiocluster_pods.go +++ b/controllers/humiocluster_pods.go @@ -48,7 +48,6 @@ const ( humioAppPath = "/app/humio" HumioDataPath = "/data/humio-data" sharedPath = "/shared" - TmpPath = "/tmp" waitForPodTimeoutSeconds = 10 ) @@ -138,11 +137,6 @@ func ConstructPod(hnp *HumioNodePool, humioNodeName string, attachments *podAtta MountPath: sharedPath, ReadOnly: true, }, - { - Name: "tmp", - MountPath: TmpPath, - ReadOnly: false, - }, }, ReadinessProbe: hnp.GetContainerReadinessProbe(), LivenessProbe: hnp.GetContainerLivenessProbe(), @@ -156,10 +150,6 @@ func ConstructPod(hnp *HumioNodePool, humioNodeName string, attachments *podAtta Name: "shared", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, }, - { - Name: "tmp", - VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, - }, }, Affinity: hnp.GetAffinity(), Tolerations: hnp.GetTolerations(), diff --git a/controllers/suite/clusters/humiocluster_controller_test.go b/controllers/suite/clusters/humiocluster_controller_test.go index 37ba30b1..64836ff1 100644 --- a/controllers/suite/clusters/humiocluster_controller_test.go +++ b/controllers/suite/clusters/humiocluster_controller_test.go @@ -3337,8 +3337,8 @@ var _ = Describe("HumioCluster Controller", func() { suite.CreateAndBootstrapCluster(ctx, k8sClient, testHumioClient, toCreate, true, humiov1alpha1.HumioClusterStateRunning, testTimeout) defer suite.CleanupCluster(ctx, k8sClient, toCreate) - initialExpectedVolumesCount := 5 // shared, tmp, humio-data, extra-kafka-configs, init-service-account-secret - initialExpectedHumioContainerVolumeMountsCount := 4 // shared, tmp, humio-data, extra-kafka-configs + initialExpectedVolumesCount := 4 // shared, humio-data, extra-kafka-configs, init-service-account-secret + initialExpectedHumioContainerVolumeMountsCount := 3 // shared, humio-data, extra-kafka-configs if !helpers.UseEnvtest() { // k8s will automatically inject a service account token @@ -4453,6 +4453,13 @@ var _ = Describe("HumioCluster Controller", func() { } updatedHumioCluster.Spec.ShareProcessNamespace = helpers.BoolPtr(true) + tmpVolumeName := "tmp" + updatedHumioCluster.Spec.ExtraVolumes = []corev1.Volume{ + { + Name: tmpVolumeName, + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }, + } updatedHumioCluster.Spec.SidecarContainers = []corev1.Container{ { Name: "jmap", @@ -4461,8 +4468,8 @@ var _ = Describe("HumioCluster Controller", func() { Args: []string{"-c", "HUMIO_PID=$(ps -e | grep java | awk '{print $1'}); while :; do sleep 30 ; jmap -histo:live $HUMIO_PID | head -n203 ; done"}, VolumeMounts: []corev1.VolumeMount{ { - Name: "tmp", - MountPath: controllers.TmpPath, + Name: tmpVolumeName, + MountPath: "/tmp", ReadOnly: false, }, },