From 969ec046d3ee789b6514969ee3a7a320d0843f1b Mon Sep 17 00:00:00 2001 From: Radoslav Dimitrov Date: Wed, 20 Dec 2023 16:29:48 +0200 Subject: [PATCH] Ensure output format is supported at artifact_get.go (#1988) --- cmd/cli/app/artifact/artifact_get.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/cli/app/artifact/artifact_get.go b/cmd/cli/app/artifact/artifact_get.go index 59fe7048df..b7d5e5444b 100644 --- a/cmd/cli/app/artifact/artifact_get.go +++ b/cmd/cli/app/artifact/artifact_get.go @@ -56,6 +56,11 @@ func getCommand(ctx context.Context, cmd *cobra.Command, conn *grpc.ClientConn) return cli.MessageAndError(fmt.Sprintf("Provider %s is not supported yet", provider), fmt.Errorf("invalid argument")) } + // Ensure the output format is supported + if !app.IsOutputFormatSupported(format) { + return cli.MessageAndError(fmt.Sprintf("Output format %s not supported", format), fmt.Errorf("invalid argument")) + } + // check artifact by name art, err := client.GetArtifactById(ctx, &minderv1.GetArtifactByIdRequest{ Context: &minderv1.Context{Provider: &provider, Project: &project},