cli: show available cli upgrades on upgrade check command (#1394)

* cli: upgrade check show cli upgrades

* only check compatibility for valid upgrades

* use semver.Sort

* extend unit tests

* add unit test for new compatible cli versions

* adapt to feedback

* fix rebase

* rework output

* minor -> major

Co-authored-by: Otto Bittner <cobittner@posteo.net>

* minor -> major

Co-authored-by: Otto Bittner <cobittner@posteo.net>

* dynamic major version

Co-authored-by: Otto Bittner <cobittner@posteo.net>

* remove currentK8sVer argument

* bazel gen & tidy

* bazel update

---------

Co-authored-by: Otto Bittner <cobittner@posteo.net>
This commit is contained in:
Moritz Sanft 2023-04-03 14:31:17 +02:00 committed by GitHub
parent 33d0b8f59d
commit 46f5b1734e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 364 additions and 56 deletions

View file

@ -18,11 +18,11 @@ import (
// CLIInfo contains information about a specific CLI version (i.e. it's compatibility with Kubernetes versions).
type CLIInfo struct {
// Ref is the reference name of the image.
// Ref is the reference name of the CLI.
Ref string `json:"ref,omitempty"`
// Stream is the stream name of the image.
// Stream is the stream name of the CLI.
Stream string `json:"stream,omitempty"`
// Version is the version of the image.
// Version is the version of the CLI.
Version string `json:"version,omitempty"`
// Kubernetes contains all compatible Kubernetes versions.
Kubernetes []string `json:"kubernetes,omitempty"`