From be97a5c1c6e1bfadb9d1fe1016c77e3747545741 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Fri, 20 Dec 2024 14:27:00 +0800 Subject: [PATCH] hide restic deprecation warning for install with crd-only Signed-off-by: Lyndon-Li --- changelogs/unreleased/8538-Lyndon-Li | 1 + pkg/cmd/cli/install/install.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 changelogs/unreleased/8538-Lyndon-Li diff --git a/changelogs/unreleased/8538-Lyndon-Li b/changelogs/unreleased/8538-Lyndon-Li new file mode 100644 index 000000000..fb039991d --- /dev/null +++ b/changelogs/unreleased/8538-Lyndon-Li @@ -0,0 +1 @@ +Fix issue #8539, validate uploader types when o.CRDsOnly is set to false only since CRD installation doesn't rely on uploader types \ No newline at end of file diff --git a/pkg/cmd/cli/install/install.go b/pkg/cmd/cli/install/install.go index e725c913d..c5d5feb33 100644 --- a/pkg/cmd/cli/install/install.go +++ b/pkg/cmd/cli/install/install.go @@ -429,17 +429,17 @@ func (o *Options) Validate(c *cobra.Command, args []string, f client.Factory) er return err } + // If we're only installing CRDs, we can skip the rest of the validation. + if o.CRDsOnly { + return nil + } + if msg, err := uploader.ValidateUploaderType(o.UploaderType); err != nil { return err } else if msg != "" { fmt.Printf("⚠️ %s\n", msg) } - // If we're only installing CRDs, we can skip the rest of the validation. - if o.CRDsOnly { - return nil - } - // Our main 3 providers don't support bucket names starting with a dash, and a bucket name starting with one // can indicate that an environment variable was left blank. // This case will help catch that error