diff --git a/cmd/rosa/main.go b/cmd/rosa/main.go index eaea46656..ef814b9f4 100644 --- a/cmd/rosa/main.go +++ b/cmd/rosa/main.go @@ -127,21 +127,21 @@ func versionCheck(cmd *cobra.Command, _ []string) { rprtr := reporter.CreateReporter() rosaVersion, err := versionUtils.NewRosaVersion() if err != nil { - rprtr.Warnf("Could not verify the current version of ROSA.") - rprtr.Warnf("You might be running on an outdated version. Make sure you are using the current version of ROSA.") + rprtr.Debugf("Could not verify the current version of ROSA: %v", err) + rprtr.Debugf("You might be running on an outdated version. Make sure you are using the current version of ROSA.") return } latestVersionFromMirror, isLatest, err := rosaVersion.IsLatest(info.Version) if err != nil { - rprtr.Warnf("There was a problem retrieving the latest version of ROSA.") - rprtr.Warnf("You might be running on an outdated version. Make sure you are using the current version of ROSA.") + rprtr.Debugf("There was a problem retrieving the latest version of ROSA: %v", err) + rprtr.Debugf("You might be running on an outdated version. Make sure you are using the current version of ROSA.") + return } if !isLatest { rprtr.Warnf("The current version (%s) is not up to date with latest released version (%s).", info.Version, latestVersionFromMirror.Original(), ) - rprtr.Warnf("It is recommended that you update to the latest version.") } } diff --git a/cmd/version/cmd_test.go b/cmd/version/cmd_test.go index e01650a5b..d4a88ce19 100644 --- a/cmd/version/cmd_test.go +++ b/cmd/version/cmd_test.go @@ -24,7 +24,18 @@ var _ = Describe("RosaVersionOptions", func() { mockVerify *rosa.MockVerifyRosa ) - When("When client only is set to false", func() { + When("calling NewRosaVersionOptions", func() { + It("should initialize ROSA Version Options correctly", func() { + options, err := NewRosaVersionOptions() + Expect(err).To(BeNil()) + Expect(options).ToNot(BeNil()) + Expect(options.reporter).ToNot(BeNil()) + Expect(options.verifyRosa).ToNot(BeNil()) + Expect(options.args).ToNot(BeNil()) + }) + }) + + When("client only is set to false", func() { BeforeEach(func() { ctrl = gomock.NewController(GinkgoT()) mockVerify = rosa.NewMockVerifyRosa(ctrl) diff --git a/cmd/version/options.go b/cmd/version/options.go index fad040afa..7b53bbff9 100644 --- a/cmd/version/options.go +++ b/cmd/version/options.go @@ -34,6 +34,7 @@ func NewRosaVersionOptions() (*RosaVersionOptions, error) { return &RosaVersionOptions{ verifyRosa: verifyRosa, reporter: reporter.CreateReporter(), + args: NewRosaVersionUserOptions(), }, nil }