Skip to content

Commit 08eab12

Browse files
authored
fix: Delete and rebuild search indices in e2e workflow (#505)
1 parent b9379a6 commit 08eab12

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ post-deploy:
117117
list-index:
118118
python manage.py opensearch index list
119119

120+
.PHONY: delete-index
121+
delete-index:
122+
python manage.py opensearch index delete --force
123+
120124
.PHONY: rebuild-index
121125
rebuild-index:
122126
python manage.py update_or_rebuild_index

k8s/projects-backend/templates/workflow-e2e.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,28 @@ spec:
4646
envFrom:
4747
- configMapRef:
4848
name: {{ tpl $.Values.fullName $ }}
49+
- name: delete-old-index
50+
container:
51+
{{- with $.Values.image }}
52+
image: {{ tpl (printf "%s/%s:%s" .repository .path .tag) $ }}
53+
{{- end }}
54+
args:
55+
- "make"
56+
- "delete-index"
57+
envFrom:
58+
- configMapRef:
59+
name: {{ tpl $.Values.fullName $ }}
60+
- name: rebuild-index
61+
container:
62+
{{- with $.Values.image }}
63+
image: {{ tpl (printf "%s/%s:%s" .repository .path .tag) $ }}
64+
{{- end }}
65+
args:
66+
- "make"
67+
- "rebuild-index"
68+
envFrom:
69+
- configMapRef:
70+
name: {{ tpl $.Values.fullName $ }}
4971
{{- if .Values.config.sensitive }}
5072
volumeMounts:
5173
- name: secrets
@@ -62,4 +84,8 @@ spec:
6284
template: flush-db
6385
- - name: create-e2e-users
6486
template: create-e2e-users
87+
- - name: delete-old-index
88+
template: delete-old-index
89+
- - name: rebuild-index
90+
template: rebuild-index
6591
{{- end }}

0 commit comments

Comments
 (0)