mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-06 14:04:17 -04:00
cli: refactor upgrade apply
cmd to match name
* `upgrade apply` will try to make the locally configured and actual version in the cluster match by appling necessary upgrades. * Skip image or kubernetes upgrades if one is already in progress. * Skip downgrades/equal-as-running versions * Move NodeVersionResourceName constant from operators to internal as its needed in the CLI.
This commit is contained in:
parent
3cebd68c24
commit
50646b2a10
18 changed files with 611 additions and 241 deletions
|
@ -26,7 +26,6 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/mod/semver"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
)
|
||||
|
||||
// TestBuildString checks that the resulting user output is as expected. Slow part is the Sscanf in parseCanonicalSemver().
|
||||
|
@ -295,10 +294,10 @@ type stubUpgradeChecker struct {
|
|||
err error
|
||||
}
|
||||
|
||||
func (u stubUpgradeChecker) GetCurrentImage(context.Context) (*unstructured.Unstructured, string, error) {
|
||||
return nil, u.image, u.err
|
||||
func (u stubUpgradeChecker) CurrentImage(context.Context) (string, error) {
|
||||
return u.image, u.err
|
||||
}
|
||||
|
||||
func (u stubUpgradeChecker) GetCurrentKubernetesVersion(ctx context.Context) (*unstructured.Unstructured, string, error) {
|
||||
return nil, u.k8sVersion, u.err
|
||||
func (u stubUpgradeChecker) CurrentKubernetesVersion(ctx context.Context) (string, error) {
|
||||
return u.k8sVersion, u.err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue