Skip to content

Commit

Permalink
fix: added validation to ensure that the new flag is not used with Ko…
Browse files Browse the repository at this point in the history
…nnect
  • Loading branch information
Prashansa-K committed Jan 15, 2025
1 parent b9235ce commit 76415b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/gateway_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"context"
"errors"
"fmt"
"os"
"strings"
Expand Down Expand Up @@ -48,6 +49,10 @@ func executeDump(cmd *cobra.Command, _ []string) error {
}

if inKonnectMode(nil) {
if dumpConfig.SkipConsumersWithConsumerGroups {
return errors.New("the flag --skip-consumers-with-consumer-groups can not be used with Konnect")
}

_ = sendAnalytics("dump", "", modeKonnect)
return dumpKonnectV2(ctx)
}
Expand Down Expand Up @@ -191,7 +196,7 @@ configure Kong.`,
dumpCmd.Flags().BoolVar(&dumpConfig.SkipConsumersWithConsumerGroups, "skip-consumers-with-consumer-groups",
false, "do not show the association between consumer and consumer-group.\n"+
"If set to true, deck skips listing consumers with consumer-groups,\n"+
"thus gaining some performance with large configs.")
"thus gaining some performance with large configs. This flag is not valid with Konnect.")
if deprecated {
dumpCmd.Flags().StringVarP(&dumpCmdKongStateFileDeprecated, "output-file", "o",
fileOutDefault, "file to which to write Kong's configuration."+
Expand Down

0 comments on commit 76415b3

Please sign in to comment.