Skip to content

Commit

Permalink
fix: set alias enable variable for spark cronjob
Browse files Browse the repository at this point in the history
Signed-off-by: Janine Olear <[email protected]>
  • Loading branch information
miyunari committed Sep 6, 2022
1 parent f579ee9 commit 69ed2a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/cronjob/spark_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand Down
5 changes: 5 additions & 0 deletions pkg/cronjob/spark_dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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"},
},
},
{
Expand All @@ -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"},
},
Expand All @@ -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"},
},
Expand All @@ -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"},
},
},
}
Expand Down

0 comments on commit 69ed2a0

Please sign in to comment.