Skip to content

Commit

Permalink
fix: apepg switchover failed (#1326)
Browse files Browse the repository at this point in the history
Co-authored-by: kizuna-lek <[email protected]>
  • Loading branch information
kizuna-lek and kizuna-lek authored Dec 17, 2024
1 parent 6ee4324 commit 26cd8fe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion addons/apecloud-postgresql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ roles:
writable: false
votable: false
vars:
## the postgres leader pod name which is dynamically selected, caution to use it
- name: POSTGRES_LEADER_POD_NAME
valueFrom:
componentVarRef:
compDef: {{ include "apecloud-postgresql-14.cmpdName" . }}
optional: true
podNamesForRole:
role: leader
option: Optional
- name: POSTGRES_USER
valueFrom:
credentialVarRef:
Expand Down Expand Up @@ -225,6 +234,13 @@ lifecycleActions:
- /tools/config/dbctl/components
- apecloud-postgresql
- getrole
switchover:
exec:
command:
- /bin/sh
- -c
- |
/tools/syncerctl switchover --primary "$POSTGRES_LEADER_POD_NAME" ${KB_SWITCHOVER_CANDIDATE_NAME:+--candidate "$KB_SWITCHOVER_CANDIDATE_NAME"}
memberLeave:
exec:
container: postgresql
Expand Down Expand Up @@ -258,7 +274,7 @@ runtime:
- command:
- sh
- -c
- cp -r /bin/syncer /tools/
- cp -r /bin/syncer /bin/syncerctl /tools/
image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.syncer.repository }}:{{ .Values.image.syncer.tag }}
imagePullPolicy: {{ default "IfNotPresent" .Values.image.pullPolicy }}
name: init-syncer
Expand Down
2 changes: 1 addition & 1 deletion addons/apecloud-postgresql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ image:
debug: false
syncer:
repository: apecloud/syncer
tag: "0.3.6"
tag: "0.4.0"

# refer: https://github.com/apecloud/dbctl/blob/main/docker/Dockerfile
dbctl:
Expand Down

0 comments on commit 26cd8fe

Please sign in to comment.