Skip to content

Commit dc103a6

Browse files
Merge pull request #371 from DodgeCamaro/update_elasticsearch_advanced_visibility_scripts
change hardcode index name for using from env vars {{ .Indices.Visibility }}
2 parents 6fe41fe + 2a300c9 commit dc103a6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/resource/persistence/template.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@ var (
153153
154154
# Guess current mapping version
155155
# v0 does not have the "ExecutionDuration" property
156-
is_v0=$(echo $current_mapping | jq -r '.temporal_visibility_v1_dev.mappings.properties | has("ExecutionDuration") | not')
156+
is_v0=$(echo $current_mapping | jq -r '.{{ .Indices.Visibility }}.mappings.properties | has("ExecutionDuration") | not')
157157
if [ $is_v0 == "true" ]; then
158158
echo "Can't do upgrade from v0 schema, version needing advanced visibility schema v1 are not supported by the operator"
159159
exit 1;
160160
fi
161161
162162
# v1 does not have the "TemporalScheduledById" property
163-
is_v1=$(echo $current_mapping | jq -r '.temporal_visibility_v1_dev.mappings.properties | has("TemporalScheduledById") | not')
163+
is_v1=$(echo $current_mapping | jq -r '.{{ .Indices.Visibility }}.mappings.properties | has("TemporalScheduledById") | not')
164164
if [ $is_v1 == "true" ]; then
165165
if [ $current_version_found = false ]; then
166166
current_version_found=true
@@ -169,7 +169,7 @@ var (
169169
fi
170170
171171
# v2 does not have the "TemporalNamespaceDivision" property
172-
is_v2=$(echo $current_mapping | jq -r '.temporal_visibility_v1_dev.mappings.properties | has("TemporalNamespaceDivision") | not')
172+
is_v2=$(echo $current_mapping | jq -r '.{{ .Indices.Visibility }}.mappings.properties | has("TemporalNamespaceDivision") | not')
173173
if [ $is_v2 == "true" ]; then
174174
if [ $current_version_found = false ]; then
175175
current_version_found=true
@@ -178,7 +178,7 @@ var (
178178
fi
179179
180180
# v3 has the "TemporalNamespaceDivision"
181-
is_v3=$(echo $current_mapping | jq -r '.temporal_visibility_v1_dev.mappings.properties | has("TemporalNamespaceDivision")')
181+
is_v3=$(echo $current_mapping | jq -r '.{{ .Indices.Visibility }}.mappings.properties | has("TemporalNamespaceDivision")')
182182
if [ $is_v3 == "true" ]; then
183183
if [ $current_version_found = false ]; then
184184
current_version_found=true
@@ -187,7 +187,7 @@ var (
187187
fi
188188
189189
# v4 has the "HistorySizeBytes"
190-
is_v4=$(echo $current_mapping | jq -r '.temporal_visibility_v1_dev.mappings.properties | has("HistorySizeBytes")')
190+
is_v4=$(echo $current_mapping | jq -r '.{{ .Indices.Visibility }}.mappings.properties | has("HistorySizeBytes")')
191191
if [ $is_v4 == "true" ]; then
192192
if [ $current_version_found = false ]; then
193193
current_version_found=true

0 commit comments

Comments
 (0)