Skip to content

Commit

Permalink
OCM-7573 | fix: ensure version option args are initialised
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranRoche committed Apr 24, 2024
1 parent 8d577cb commit 6fca5c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/rosa/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,20 @@ 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.")
}
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.")
}
}
1 change: 1 addition & 0 deletions cmd/version/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func NewRosaVersionOptions() (*RosaVersionOptions, error) {
return &RosaVersionOptions{
verifyRosa: verifyRosa,
reporter: reporter.CreateReporter(),
args: NewRosaVersionUserOptions(),
}, nil
}

Expand Down

0 comments on commit 6fca5c0

Please sign in to comment.