diff --git a/pkg/cronjob/spark_dependencies.go b/pkg/cronjob/spark_dependencies.go index d3d4a6faf..08c2dbdf0 100644 --- a/pkg/cronjob/spark_dependencies.go +++ b/pkg/cronjob/spark_dependencies.go @@ -172,6 +172,7 @@ func getStorageEnvs(s v1.JaegerStorageSpec) []corev1.EnvVar { {Name: "ES_USERNAME", Value: sFlagsMap["es.username"]}, {Name: "ES_PASSWORD", Value: sFlagsMap["es.password"]}, {Name: "ES_TIME_RANGE", Value: s.Dependencies.ElasticsearchTimeRange}, + {Name: "ES_USE_ALIASES", Value: sFlagsMap["es.use-aliases"]}, } if s.Dependencies.ElasticsearchNodesWanOnly != nil { vars = append(vars, corev1.EnvVar{Name: "ES_NODES_WAN_ONLY", Value: strconv.FormatBool(*s.Dependencies.ElasticsearchNodesWanOnly)}) diff --git a/pkg/cronjob/spark_dependencies_test.go b/pkg/cronjob/spark_dependencies_test.go index 63992567f..825600723 100644 --- a/pkg/cronjob/spark_dependencies_test.go +++ b/pkg/cronjob/spark_dependencies_test.go @@ -69,6 +69,7 @@ func TestStorageEnvs(t *testing.T) { Options: v1.NewOptions(map[string]interface{}{ "es.server-urls": "lol:hol", "es.index-prefix": "haha", "es.index-date-separator": ".", "es.username": "jdoe", "es.password": "none", + "es.use-aliases": "true", }), }, expected: []corev1.EnvVar{ @@ -78,6 +79,7 @@ func TestStorageEnvs(t *testing.T) { {Name: "ES_USERNAME", Value: "jdoe"}, {Name: "ES_PASSWORD", Value: "none"}, {Name: "ES_TIME_RANGE", Value: ""}, + {Name: "ES_USE_ALIASES", Value: "true"}, }, }, { @@ -96,6 +98,7 @@ func TestStorageEnvs(t *testing.T) { {Name: "ES_USERNAME", Value: "jdoe"}, {Name: "ES_PASSWORD", Value: "none"}, {Name: "ES_TIME_RANGE", Value: ""}, + {Name: "ES_USE_ALIASES", Value: ""}, {Name: "ES_NODES_WAN_ONLY", Value: "false"}, {Name: "ES_CLIENT_NODE_ONLY", Value: "true"}, }, @@ -106,6 +109,7 @@ func TestStorageEnvs(t *testing.T) { Options: v1.NewOptions(map[string]interface{}{ "es.server-urls": "lol:hol", "es.index-prefix": "haha", "es.username": "jdoe", "es.password": "none", + "es.use-aliases": "false", }), Dependencies: v1.JaegerDependenciesSpec{ElasticsearchTimeRange: "30m"}, }, @@ -116,6 +120,7 @@ func TestStorageEnvs(t *testing.T) { {Name: "ES_USERNAME", Value: "jdoe"}, {Name: "ES_PASSWORD", Value: "none"}, {Name: "ES_TIME_RANGE", Value: "30m"}, + {Name: "ES_USE_ALIASES", Value: "false"}, }, }, }