mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
cli: fix upgrades when using outdated Kubernetes patch version (#2718)
* Fix missing image for Constellation operators in our Helm charts if the desired Kubernetes patch version is no longer supported (but Kubernetes upgrades are skipped) * Correctly unmarshal Kubernetes Components list if the list uses an old format --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
724ee44466
commit
a1f67d0884
5 changed files with 130 additions and 1 deletions
31
internal/versions/components/components_test.go
Normal file
31
internal/versions/components/components_test.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package components
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestUnmarshalComponents(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
require := require.New(t)
|
||||
|
||||
legacyFormat := `[{"URL":"https://example.com/foo.tar.gz","Hash":"1234567890","InstallPath":"/foo","Extract":true}]`
|
||||
newFormat := `[{"url":"https://example.com/foo.tar.gz","hash":"1234567890","install_path":"/foo","extract":true}]`
|
||||
|
||||
var fromLegacy Components
|
||||
require.NoError(json.Unmarshal([]byte(legacyFormat), &fromLegacy))
|
||||
|
||||
var fromNew Components
|
||||
require.NoError(json.Unmarshal([]byte(newFormat), &fromNew))
|
||||
|
||||
assert.Equal(fromLegacy, fromNew)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue