-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix default elasticsearch-data
volumeMount configuration
#6725
Conversation
Another approach could be to move the call to diff --git a/pkg/controller/elasticsearch/nodespec/podspec.go b/pkg/controller/elasticsearch/nodespec/podspec.go
index 52fcda3cd..a012d3f12 100644
--- a/pkg/controller/elasticsearch/nodespec/podspec.go
+++ b/pkg/controller/elasticsearch/nodespec/podspec.go
@@ -110,7 +110,11 @@ func BuildPodTemplateSpec(
WithReadinessProbe(*NewReadinessProbe()).
WithAffinity(DefaultAffinity(es.Name)).
WithEnv(DefaultEnvVars(es.Spec.HTTP, headlessServiceName)...).
- WithVolumes(volumes...).
+ WithVolumes(volumes...)
+
+ volumeMounts = esvolume.AppendDefaultDataVolumeMount(volumeMounts, volumes)
+
+ builder = builder.
WithVolumeMounts(volumeMounts...).
WithInitContainers(initContainers...).
|
Since there is always an diff --git a/pkg/controller/elasticsearch/nodespec/volumes.go b/pkg/controller/elasticsearch/nodespec/volumes.go
index c5da73430..beabe273b 100644
--- a/pkg/controller/elasticsearch/nodespec/volumes.go
+++ b/pkg/controller/elasticsearch/nodespec/volumes.go
@@ -106,6 +106,7 @@ func buildVolumes(
scriptsVolume.VolumeMount(),
configVolume.VolumeMount(),
downwardAPIVolume.VolumeMount(),
+ esvolume.DefaultDataVolumeMount,
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM I did a couple of tests and I think it works as expected. I also think it is safe as use provided mounts will still prevail.
@@ -114,7 +114,7 @@ func buildVolumes( | |||
volumeMounts = append(volumeMounts, fileSettingsVolume.VolumeMount()) | |||
} | |||
|
|||
volumeMounts = esvolume.AppendDefaultDataVolumeMount(volumeMounts, volumes) | |||
volumeMounts = esvolume.AppendDefaultDataVolumeMount(volumeMounts, append(volumes, nodeSpec.PodTemplate.Spec.Volumes...)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comment here to explain why we are suddenly including the user provided PodTemplate here.
This commit ensures that we take into account the volumes provided by the user to append the default
elasticsearch-data
volumeMount.Resolves #6186.