Skip to content

Commit

Permalink
fix(flags): Only query for primary instance if pod flag not set
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Oct 19, 2023
1 parent 4cbbf12 commit 8a2cc7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/util/cmd_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ func DefaultSetup(cmd *cobra.Command, conf *config.Global, opts SetupOptions) (e
}
}

pods, err = conf.Dialect.FilterPods(cmd.Context(), conf.Client, pods)
if err != nil {
log.WithError(err).Warn("could not query primary instance")
if podFlag == "" {
pods, err = conf.Dialect.FilterPods(cmd.Context(), conf.Client, pods)
if err != nil {
log.WithError(err).Warn("could not query primary instance")
}
}

if len(pods) == 1 {
Expand Down

0 comments on commit 8a2cc7c

Please sign in to comment.