-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
install: Move the logic to unschedule aws-node to preinstall
- Move the logic to unschedule aws-node pods from Install to preinstall so that it can be shared between classic and helm mode. - Look for cni.chainingMode Helm value instead of generating configmap and looking for cni-chaining-mode field. It is alarming to see cilium-cli mutating objects that it does not own, but I guess that's a separate discussion altogether... Signed-off-by: Michi Mutsuzaki <[email protected]>
- Loading branch information
1 parent
371a966
commit 493031b
Showing
2 changed files
with
63 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Authors of Cilium | ||
|
||
package install | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"helm.sh/helm/v3/pkg/cli" | ||
"helm.sh/helm/v3/pkg/cli/values" | ||
"helm.sh/helm/v3/pkg/getter" | ||
) | ||
|
||
func Test_getChainingMode(t *testing.T) { | ||
assert.Equal(t, "", getChainingMode(nil)) | ||
|
||
opts := values.Options{} | ||
vals, err := opts.MergeValues(getter.All(cli.New())) | ||
assert.NoError(t, err) | ||
assert.Equal(t, "", getChainingMode(vals)) | ||
|
||
opts = values.Options{JSONValues: []string{"cni={}"}} | ||
vals, err = opts.MergeValues(getter.All(cli.New())) | ||
assert.NoError(t, err) | ||
assert.Equal(t, "", getChainingMode(vals)) | ||
|
||
opts = values.Options{Values: []string{"cni.chainingMode=aws-cni"}} | ||
vals, err = opts.MergeValues(getter.All(cli.New())) | ||
assert.NoError(t, err) | ||
assert.Equal(t, "aws-cni", getChainingMode(vals)) | ||
} |