Skip to content

Commit

Permalink
Use /leader as default trigger key for Patroni DCS type
Browse files Browse the repository at this point in the history
  • Loading branch information
mbanck-ntap committed Nov 15, 2024
1 parent 9b30051 commit 4e4293a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vipconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,14 @@ func NewConfig() (*Config, error) {
}
}

// set trigger-key to '/leader' if DCS type is patroni and nothing is specified
if triggerKey := viper.GetString("trigger-key"); len(triggerKey) == 0 {
if viper.GetString("dcs-type") == "patroni" {
triggerKey = "/leader"
viper.Set("trigger-key", triggerKey)
}
}

// set trigger-value to default value if nothing is specified
if triggerValue := viper.GetString("trigger-value"); len(triggerValue) == 0 {
if viper.GetString("dcs-type") == "patroni" {
Expand Down

0 comments on commit 4e4293a

Please sign in to comment.