Skip to content

Commit

Permalink
♻️ Use command.Builder for Postgres HA pod filter
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Mar 24, 2022
1 parent b1e39c1 commit 763c3b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/database/grammar/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,12 @@ func (Postgres) FilterPods(client kubernetes.KubeClient, pods []v1.Pod) ([]v1.Po
log.Info("querying for primary instance")
cmd := []string{
"sh", "-c",
"DISABLE_WELCOME_MESSAGE=true /opt/bitnami/scripts/postgresql-repmgr/entrypoint.sh " +
"repmgr --config-file=/opt/bitnami/repmgr/conf/repmgr.conf " +
"service status --csv",
command.NewBuilder(
command.NewEnv("DISABLE_WELCOME_MESSAGE", "true"),
"/opt/bitnami/scripts/postgresql-repmgr/entrypoint.sh",
"repmgr", "--config-file=/opt/bitnami/repmgr/conf/repmgr.conf",
"service", "status", "--csv",
).String(),
}

var buf strings.Builder
Expand Down

0 comments on commit 763c3b6

Please sign in to comment.