Skip to content

Commit 6d30201

Browse files
author
Brian Strauch
authored
deprecate broken cluster linking flags (#1174)
1 parent 5f537e1 commit 6d30201

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

internal/cmd/kafka/command_link_create.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ func (c *linkCommand) newCreateCommand() *cobra.Command {
5656
"Must be used with --source-api-key.")
5757
cmd.Flags().String(configFileFlagName, "", "Name of the file containing link config overrides. "+
5858
"Each property key-value pair should have the format of key=value. Properties are separated by new-line characters.")
59-
cmd.Flags().Bool(dryrunFlagName, false, "If set, will NOT actually create the link, but simply validates it.")
60-
cmd.Flags().Bool(noValidateFlagName, false, "If set, will create the link even if the source cluster cannot be reached with the supplied bootstrap server and credentials.")
59+
cmd.Flags().Bool(dryrunFlagName, false, "DEPRECATED: Validate a link, but do not create it (this flag is no longer active).")
60+
cmd.Flags().Bool(noValidateFlagName, false, "DEPRECATED: Create a link even if the source cluster cannot be reached (this flag is no longer active).")
6161
pcmd.AddClusterFlag(cmd, c.AuthenticatedCLICommand)
6262
pcmd.AddContextFlag(cmd, c.CLICommand)
6363
pcmd.AddEnvironmentFlag(cmd, c.AuthenticatedCLICommand)
@@ -81,16 +81,6 @@ func (c *linkCommand) create(cmd *cobra.Command, args []string) error {
8181
return err
8282
}
8383

84-
validateOnly, err := cmd.Flags().GetBool(dryrunFlagName)
85-
if err != nil {
86-
return err
87-
}
88-
89-
_, err = cmd.Flags().GetBool(noValidateFlagName)
90-
if err != nil {
91-
return err
92-
}
93-
9484
configFile, err := cmd.Flags().GetString(configFileFlagName)
9585
if err != nil {
9686
return err
@@ -157,11 +147,7 @@ func (c *linkCommand) create(cmd *cobra.Command, args []string) error {
157147
kafkaREST.Context, lkc, linkName, createLinkOpt)
158148

159149
if err == nil {
160-
msg := errors.CreatedLinkMsg
161-
if validateOnly {
162-
msg = errors.DryRunPrefix + msg
163-
}
164-
utils.Printf(cmd, msg, linkName)
150+
utils.Printf(cmd, errors.CreatedLinkMsg, linkName)
165151
return nil
166152
}
167153

internal/pkg/errors/strings.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ const (
5757
UpdateTopicConfigMsg = "Updated the following configs for topic \"%s\":\n"
5858

5959
// kafka link commands
60-
DryRunPrefix = "[DRY RUN] "
6160
DeletedLinkMsg = "Deleted cluster link \"%s\".\n"
6261
CreatedLinkMsg = "Created cluster link \"%s\".\n"
6362
UpdatedLinkMsg = "Updated cluster link \"%s\".\n"

0 commit comments

Comments
 (0)