@@ -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