mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-20 07:00:32 -04:00
AB#2504: Deploy join-service via helm (#358)
This commit is contained in:
parent
d46408d00b
commit
c2814aeddb
30 changed files with 434 additions and 378 deletions
92
bootstrapper/internal/helm/client_test.go
Normal file
92
bootstrapper/internal/helm/client_test.go
Normal file
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package helm
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestMe(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
vals map[string]interface{}
|
||||
extraVals map[string]interface{}
|
||||
expected map[string]interface{}
|
||||
}{
|
||||
"equal": {
|
||||
vals: map[string]interface{}{
|
||||
"join-service": map[string]interface{}{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
},
|
||||
},
|
||||
extraVals: map[string]interface{}{
|
||||
"join-service": map[string]interface{}{
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
expected: map[string]interface{}{
|
||||
"join-service": map[string]interface{}{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
},
|
||||
"missing join-service extraVals": {
|
||||
vals: map[string]interface{}{
|
||||
"join-service": map[string]interface{}{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
},
|
||||
},
|
||||
extraVals: map[string]interface{}{
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
expected: map[string]interface{}{
|
||||
"join-service": map[string]interface{}{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
},
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
"missing join-service vals": {
|
||||
vals: map[string]interface{}{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
},
|
||||
extraVals: map[string]interface{}{
|
||||
"join-service": map[string]interface{}{
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
expected: map[string]interface{}{
|
||||
"key1": "foo",
|
||||
"key2": "bar",
|
||||
"join-service": map[string]interface{}{
|
||||
"extraKey1": "extraFoo",
|
||||
"extraKey2": "extraBar",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
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