Skip to content

Commit

Permalink
Remove unused tmp volume
Browse files Browse the repository at this point in the history
  • Loading branch information
SaaldjorMike committed Oct 28, 2024
1 parent a1cea0f commit 33494ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
10 changes: 0 additions & 10 deletions controllers/humiocluster_pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const (
humioAppPath = "/app/humio"
HumioDataPath = "/data/humio-data"
sharedPath = "/shared"
TmpPath = "/tmp"
waitForPodTimeoutSeconds = 10
)

Expand Down Expand Up @@ -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(),
Expand All @@ -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(),
Expand Down
15 changes: 11 additions & 4 deletions controllers/suite/clusters/humiocluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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,
},
},
Expand Down

0 comments on commit 33494ae

Please sign in to comment.