replicatedhq/kots

Odd error seen from warning about version mismatch

kelvintaywl opened this issue · 2 comments

First of all, thank you for introducing this change: #2550

I wanted to check with you folks, regarding an odd error we are seeing when running the admin-console.

Specifically, we have the KOTS cli installed at version 1.65.0.
This was done via:

$ curl https://kots.io/install/v1.65.0 | bash
[redacted]
Installed at /usr/local/bin/kubectl-kots

Then, when starting the admin-console, somehow we see the following warning:

$ kubectl kots admin-console -n <namespace>

• Press Ctrl+C to exit
• Go to http://localhost:8800/ to access the Admin Console
^C • Cleaning up
KOTS CLI version 1.65.0 does not match API version v1.65.0. To update, run:
$ curl https://kots.io/install/v1.65.0 | bash

I understand the warning, KOTS CLI version 1.65.0 does not match API version v1.65.0. To update ... was introduced from the above PR #2550

Looking at the source code as of v1.65.0, this looks to be a string-to-string comparison:

if cliVersion != apiVersion {
updateCmd := fmt.Sprintf("curl https://kots.io/install/%s | bash", apiVersion)
fmt.Fprintf(os.Stderr, "KOTS CLI version %s does not match API version %s. To update, run:\n $ %s\n", cliVersion, apiVersion, updateCmd)
}
return nil

From here, I can see the apiVersion returns v1.65.0, while cliVersion returns simply 1.65.0 (without the v prefix).
I assume this is why we are seeing the warning above.

Would this be a known issue, and perhaps, this can be ignored? 🤔

I understand that this is simply a warning.
Looking at the latest version of the check-version.go, I note that the check considers semver patterns now:

func CompareVersions(cliVersion string, apiVersion string, log *logger.CLILogger) error {
cliSemver, err := semver.ParseTolerant(cliVersion)
if err != nil {
return errors.Wrap(err, "failed to parse cli semver")
}
apiSemver, err := semver.ParseTolerant(apiVersion)
if err != nil {
return errors.Wrap(err, "failed to parse api semver")
}
if cliSemver.String() != apiSemver.String() {
updateCmd := fmt.Sprintf("curl https://kots.io/install/%s | bash", apiSemver.String())
log.Errorf("KOTS CLI version %s does not match API version %s. To update, run:\n $ %s\n", cliSemver.String(), apiSemver.String(), updateCmd)
}
return nil
}

As such, perhaps this was a minor issue as noted up to v.1.65.0?

Thank you so much 🙇

Hi @kelvintaywl 👋 ,

Yes, you are correct! This is a known issue in v1.65.0, but was subsequently resolved in v1.66.0 and onwards (release notes here). I'm going to close out this issue since that warning can be safely ignored in v1.65.0.

thanks again, @cbodonnell ! 🙏