diff --git a/cmd/kong.go b/cmd/gateway.go similarity index 67% rename from cmd/kong.go rename to cmd/gateway.go index db960e84c..e4f1c7d9d 100644 --- a/cmd/kong.go +++ b/cmd/gateway.go @@ -1,6 +1,3 @@ -/* -Copyright © 2023 NAME HERE -*/ package cmd import ( @@ -9,13 +6,13 @@ import ( // // -// Define the CLI data for the kong sub-command +// Define the CLI data for the gateway sub-command // // func newKongSubCmd() *cobra.Command { kongSubCmd := &cobra.Command{ - Use: "kong [sub-command]...", + Use: "gateway [sub-command]...", Short: "Sub-command to host the decK network operations", Long: `Sub-command to host the decK network operations`, } diff --git a/cmd/kong_diff.go b/cmd/gateway_diff.go similarity index 97% rename from cmd/kong_diff.go rename to cmd/gateway_diff.go index 30653706e..c3a1be28c 100644 --- a/cmd/kong_diff.go +++ b/cmd/gateway_diff.go @@ -36,10 +36,10 @@ func newDiffCmd(deprecated bool) *cobra.Command { if deprecated { use = "diff" - short = "[deprecated] use 'kong diff' instead" + short = "[deprecated] use 'gateway diff' instead" execute = func(cmd *cobra.Command, args []string) error { cprint.UpdatePrintf("Warning: 'deck diff' is DEPRECATED and will be removed in a future version. " + - "Use 'deck kong diff' instead.\n") + "Use 'deck gateway diff' instead.\n") return executeDiff(cmd, args) } argsValidator = validateNoArgs diff --git a/cmd/kong_dump.go b/cmd/gateway_dump.go similarity index 96% rename from cmd/kong_dump.go rename to cmd/gateway_dump.go index f1e961e4e..95637646a 100644 --- a/cmd/kong_dump.go +++ b/cmd/gateway_dump.go @@ -14,6 +14,8 @@ import ( "github.com/spf13/cobra" ) +const defaultFileOutName = "kong" + var ( dumpCmdKongStateFile string dumpCmdStateFormat string @@ -67,7 +69,7 @@ func executeDump(cmd *cobra.Command, _ []string) error { if dumpWorkspace != "" { return fmt.Errorf("workspace cannot be specified with --all-workspace flag") } - if dumpCmdKongStateFile != "kong" { + if dumpCmdKongStateFile != defaultFileOutName { return fmt.Errorf("output-file cannot be specified with --all-workspace flag") } workspaces, err := listWorkspaces(ctx, wsClient) @@ -145,13 +147,13 @@ func newDumpCmd(deprecated bool) *cobra.Command { execute := executeDump fileOutDefault := "-" if deprecated { - short = "[deprecated] use 'kong dump' instead" + short = "[deprecated] use 'gateway dump' instead" execute = func(cmd *cobra.Command, args []string) error { cprint.UpdatePrintf("Warning: 'deck dump' is DEPRECATED and will be removed in a future version. " + - "Use 'deck kong dump' instead.\n") + "Use 'deck gateway dump' instead.\n") return executeDump(cmd, args) } - fileOutDefault = "kong" + fileOutDefault = defaultFileOutName } dumpCmd := &cobra.Command{ diff --git a/cmd/kong_ping.go b/cmd/gateway_ping.go similarity index 96% rename from cmd/kong_ping.go rename to cmd/gateway_ping.go index 0d9b2d0d6..485daebcd 100644 --- a/cmd/kong_ping.go +++ b/cmd/gateway_ping.go @@ -26,10 +26,10 @@ func newPingCmd(deprecated bool) *cobra.Command { short := "Verify connectivity with Kong" execute := executePing if deprecated { - short = "[deprecated] use 'kong ping' instead" + short = "[deprecated] use 'gateway ping' instead" execute = func(cmd *cobra.Command, args []string) error { cprint.UpdatePrintf("Warning: 'deck ping' is DEPRECATED and will be removed in a future version. " + - "Use 'deck kong ping' instead.\n") + "Use 'deck gateway ping' instead.\n") return executePing(cmd, args) } } diff --git a/cmd/kong_reset.go b/cmd/gateway_reset.go similarity index 97% rename from cmd/kong_reset.go rename to cmd/gateway_reset.go index fc5feef48..a727e18d5 100644 --- a/cmd/kong_reset.go +++ b/cmd/gateway_reset.go @@ -102,10 +102,10 @@ func newResetCmd(deprecated bool) *cobra.Command { short := "Reset deletes all entities in Kong" execute := executeReset if deprecated { - short = "[deprecated] use 'kong reset' instead" + short = "[deprecated] use 'gateway reset' instead" execute = func(cmd *cobra.Command, args []string) error { cprint.UpdatePrintf("Warning: 'deck reset' is DEPRECATED and will be removed in a future version. " + - "Use 'deck kong reset' instead.\n") + "Use 'deck gateway reset' instead.\n") return executeReset(cmd, args) } } diff --git a/cmd/kong_sync.go b/cmd/gateway_sync.go similarity index 97% rename from cmd/kong_sync.go rename to cmd/gateway_sync.go index b6e89501e..11e236ca6 100644 --- a/cmd/kong_sync.go +++ b/cmd/gateway_sync.go @@ -37,10 +37,10 @@ func newSyncCmd(deprecated bool) *cobra.Command { if deprecated { use = "sync" - short = "[deprecated] use 'kong sync' instead" + short = "[deprecated] use 'gateway sync' instead" execute = func(cmd *cobra.Command, args []string) error { cprint.UpdatePrintf("Warning: 'deck sync' is DEPRECATED and will be removed in a future version. " + - "Use 'deck kong sync' instead.\n") + "Use 'deck gateway sync' instead.\n") return executeSync(cmd, args) } argsValidator = validateNoArgs diff --git a/cmd/kong_validate.go b/cmd/gateway_validate.go similarity index 98% rename from cmd/kong_validate.go rename to cmd/gateway_validate.go index 88dc84c53..7575de0f4 100644 --- a/cmd/kong_validate.go +++ b/cmd/gateway_validate.go @@ -94,7 +94,7 @@ and alerts if there are broken relationships, or missing links present. if deprecated { use = "validate" - short = "[deprecated] use 'kong validate' instead" + short = "[deprecated] use 'gateway validate' instead" long = `The validate command reads the state file and ensures validity. It reads all the specified state files and reports YAML/JSON parsing issues. It also checks for foreign relationships @@ -106,7 +106,7 @@ this command unless --online flag is used. execute = func(cmd *cobra.Command, args []string) error { cprint.UpdatePrintf("Warning: 'deck validate' is DEPRECATED and will be removed in a future version. " + - "Use 'deck kong validate' instead.\n") + "Use 'deck gateway validate' instead.\n") return executeValidate(cmd, args) } argsValidator = validateNoArgs @@ -128,7 +128,7 @@ this command unless --online flag is used. short = short + " (locally)" long = long + "No communication takes places between decK and Kong during the execution of\n" + "this command. This is faster than the online validation, but catches fewer errors.\n" + - "For online validation see 'deck kong validate'.\n" + "For online validation see 'deck gateway validate'.\n" } } diff --git a/cmd/root.go b/cmd/root.go index f07859e22..8cef759ad 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -74,7 +74,7 @@ It can be used to export, import, or sync entities to Kong.`, viper.BindPFlag("analytics", rootCmd.PersistentFlags().Lookup("analytics")) - // TODO: everything below are online flags to be moved to the "kong" subcommand + // TODO: everything below are online flags to be moved to the "gateway" subcommand // moving them now would break to top-level commands (sync, diff, etc) we still // need for backward compatibility. rootCmd.PersistentFlags().String("kong-addr", defaultKongURL,