From bfc190d964c66cb6d78b11a4900f290e96c01006 Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Fri, 31 Aug 2018 17:31:36 +0200 Subject: [PATCH] cli: mark `cockroach zone` commands as deprecated Requested/suggested by @benesch: this patch makes the various `cockroach zone` sub-commands report a deprecation warning and a reference to the new SQL interface: ``` $ cockroach zone ls Command "ls" is deprecated, use SHOW ZONE CONFIGURATIONS in a SQL client instead. $ cockroach zone get .default Command "get" is deprecated, use SHOW ZONE CONFIGURATION FOR ... in a SQL client instead. $ cockroach zone set .default Command "set" is deprecated, use ALTER ... CONFIGURE ZONE in a SQL client instead. $ cockroach zone rm liveness Command "rm" is deprecated, use ALTER ... CONFIGURE ZONE DISCARD in a SQL client instead. ``` Release note (cli change): The various `cockroach zone` sub-commands are now deprecated and will be removed in a future version of CockroachDB. Clients should use the SQL interface instead via `SHOW ZONE CONFIGURATION(s)` or `ALTER ... CONFIGURE ZONE`. --- pkg/cli/zone.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkg/cli/zone.go b/pkg/cli/zone.go index 11caa0286802..22b240e89349 100644 --- a/pkg/cli/zone.go +++ b/pkg/cli/zone.go @@ -61,8 +61,9 @@ var getZoneCmd = &cobra.Command{ Fetches and displays the zone configuration for the specified database or table. `, - Args: cobra.ExactArgs(1), - RunE: MaybeDecorateGRPCError(runGetZone), + Args: cobra.ExactArgs(1), + RunE: MaybeDecorateGRPCError(runGetZone), + Deprecated: "use SHOW ZONE CONFIGURATION FOR ... in a SQL client instead.", } // runGetZone retrieves the zone config for a given object id, @@ -126,8 +127,9 @@ var lsZonesCmd = &cobra.Command{ Long: ` List zone configs. `, - Args: cobra.NoArgs, - RunE: MaybeDecorateGRPCError(runLsZones), + Args: cobra.NoArgs, + RunE: MaybeDecorateGRPCError(runLsZones), + Deprecated: "use SHOW ZONE CONFIGURATIONS in a SQL client instead.", } func runLsZones(cmd *cobra.Command, args []string) error { @@ -179,8 +181,9 @@ var rmZoneCmd = &cobra.Command{ Long: ` Remove an existing zone config for the specified database or table. `, - Args: cobra.ExactArgs(1), - RunE: MaybeDecorateGRPCError(runRmZone), + Args: cobra.ExactArgs(1), + RunE: MaybeDecorateGRPCError(runRmZone), + Deprecated: "use ALTER ... CONFIGURE ZONE DISCARD in a SQL client instead.", } func runRmZone(cmd *cobra.Command, args []string) error { @@ -236,8 +239,9 @@ EOF Note that the specified zone config is merged with the existing zone config for the database or table. `, - Args: cobra.ExactArgs(1), - RunE: MaybeDecorateGRPCError(runSetZone), + Args: cobra.ExactArgs(1), + RunE: MaybeDecorateGRPCError(runSetZone), + Deprecated: "use ALTER ... CONFIGURE ZONE in a SQL client instead.", } func readZoneConfig() (conf []byte, err error) {