From d894c2adf02a21e4e519305fb365188971c36863 Mon Sep 17 00:00:00 2001 From: Alba Hita Catala Date: Wed, 28 Feb 2024 10:32:04 +0100 Subject: [PATCH] OCM-6407 | edit option sends an empty payload This commit adds a parameter when creating the command that check for a minimum amount of arguments. The command will fail if no parameters are used. Signed-off-by: Alba Hita Catala --- cmd/ocm/edit/cluster/cmd.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/ocm/edit/cluster/cmd.go b/cmd/ocm/edit/cluster/cmd.go index fff4b8ed..7e995454 100644 --- a/cmd/ocm/edit/cluster/cmd.go +++ b/cmd/ocm/edit/cluster/cmd.go @@ -47,6 +47,7 @@ var Cmd = &cobra.Command{ Example: ` # Edit a cluster named "mycluster" to make it private ocm edit cluster mycluster --private`, RunE: run, + Args: cobra.MinimumNArgs(1), } func init() { @@ -132,7 +133,7 @@ func wasClusterWideProxyReceived(httpProxy, httpsProxy, noProxy, additionalTrust } func run(cmd *cobra.Command, argv []string) error { - // Check that there is exactly one cluster name, identifir or external identifier in the + // Check that there is exactly one cluster name, identifier or external identifier in the // command line arguments: if len(argv) != 1 { return fmt.Errorf(