Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/temporal/templates/server-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ spec:
{{- fail (printf "manageSchema is not supported for %s SQL database plugin" $store.config.pluginName) -}}
{{- end }}
{{- else if eq $store.driver "elasticsearch" }}
- temporal-elasticsearch-tool setup-schema && temporal-elasticsearch-tool create-index && temporal-elasticsearch-tool update-schema --index "$ES_VISIBILITY_INDEX"
- temporal-elasticsearch-tool update-schema && temporal-elasticsearch-tool create-index && temporal-elasticsearch-tool update-schema --index "$ES_VISIBILITY_INDEX"
{{- end }}
env:
{{- include "temporal.admintools-env" (list $ $store) | nindent 12 }}
Expand Down
50 changes: 50 additions & 0 deletions charts/temporal/tests/server_job_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -585,3 +585,53 @@ tests:
- equal:
path: spec.template.spec.initContainers[?(@.name=="manage-schema-default-store")].env[?(@.name=="SQL_PORT")].value
value: "5432"
- it: does not use setup-schema for elasticsearch
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right layer to test this, you can drop the tests.

set:
server:
config:
persistence:
datastores:
default:
sql:
pluginName: mysql8
connectAddr: "temporal-persistence:3306"
databaseName: temporal
visibility:
elasticsearch:
version: v7
url:
scheme: http
host: "elasticsearch:9200"
username: ""
password: ""
indices:
visibility: temporal_visibility_v1
asserts:
- notMatchRegex:
path: spec.template.spec.initContainers[?(@.name=="manage-schema-visibility-store")].args[0]
pattern: "setup-schema"
- it: uses update-schema and create-index for elasticsearch
set:
server:
config:
persistence:
datastores:
default:
sql:
pluginName: mysql8
connectAddr: "temporal-persistence:3306"
databaseName: temporal
visibility:
elasticsearch:
version: v7
url:
scheme: http
host: "elasticsearch:9200"
username: ""
password: ""
indices:
visibility: temporal_visibility_v1
asserts:
- matchRegex:
path: spec.template.spec.initContainers[?(@.name=="manage-schema-visibility-store")].args[0]
pattern: "update-schema && temporal-elasticsearch-tool create-index && temporal-elasticsearch-tool update-schema --index"
Loading