Skip to content

Commit

Permalink
OCM-6407 | edit option sends an empty payload
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ahitacat committed Mar 1, 2024
1 parent 1095264 commit d894c2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/ocm/edit/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d894c2a

Please sign in to comment.