mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-08 23:12:18 -04:00
cli: install cilium in cli instead of bootstrapper (#2146)
* add wait and restartDS * cilium working (tested on azure + gcp) * clean helm code from bootstrapper * fixup! clean helm code from bootstrapper * fixup! clean helm code from bootstrapper * fixup! clean helm code from bootstrapper * add patchnode for gcp * fix gcp * patch node inside bootstrapper * apply renaming of client * fixup! apply renaming of client * otto feedback
This commit is contained in:
parent
da1376cd90
commit
13eea1ca31
36 changed files with 519 additions and 575 deletions
109
cli/internal/helm/helm_test.go
Normal file
109
cli/internal/helm/helm_test.go
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package helm
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestMergeMaps(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
vals map[string]any
|
||||
extraVals map[string]any
|
||||
expected map[string]any
|
||||
}{
|
||||
"equal": {
|
||||
vals: map[string]any{
|
||||
"join-service": map[string]any{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
},
|
||||
},
|
||||
extraVals: map[string]any{
|
||||
"join-service": map[string]any{
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
expected: map[string]any{
|
||||
"join-service": map[string]any{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
},
|
||||
"missing join-service extraVals": {
|
||||
vals: map[string]any{
|
||||
"join-service": map[string]any{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
},
|
||||
},
|
||||
extraVals: map[string]any{
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
expected: map[string]any{
|
||||
"join-service": map[string]any{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
},
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
"missing join-service vals": {
|
||||
vals: map[string]any{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
},
|
||||
extraVals: map[string]any{
|
||||
"join-service": map[string]any{
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
expected: map[string]any{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
"join-service": map[string]any{
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
},
|
||||
"key collision": {
|
||||
vals: map[string]any{
|
||||
"join-service": map[string]any{
|
||||
"key1": "foo",
|
||||
},
|
||||
},
|
||||
extraVals: map[string]any{
|
||||
"join-service": map[string]any{
|
||||
"key1": "bar",
|
||||
},
|
||||
},
|
||||
expected: map[string]any{
|
||||
"join-service": map[string]any{
|
||||
"key1": "bar",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
newVals := mergeMaps(tc.vals, tc.extraVals)
|
||||
assert.Equal(tc.expected, newVals)
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue