Use config file values in node-args annotation

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
pull/3304/head
Brad Davidson 4 years ago committed by Brad Davidson
parent e998cd110d
commit fc037e87f8

@ -9,6 +9,7 @@ import (
"strings" "strings"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/rancher/k3s/pkg/configfilearg"
"github.com/rancher/k3s/pkg/version" "github.com/rancher/k3s/pkg/version"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
) )
@ -25,7 +26,7 @@ const (
func getNodeArgs() (string, error) { func getNodeArgs() (string, error) {
nodeArgsList := []string{} nodeArgsList := []string{}
for _, arg := range os.Args[1:] { for _, arg := range configfilearg.MustParse(os.Args[1:]) {
if strings.HasPrefix(arg, "--") && strings.Contains(arg, "=") { if strings.HasPrefix(arg, "--") && strings.Contains(arg, "=") {
parsedArg := strings.SplitN(arg, "=", 2) parsedArg := strings.SplitN(arg, "=", 2)
nodeArgsList = append(nodeArgsList, parsedArg...) nodeArgsList = append(nodeArgsList, parsedArg...)

Loading…
Cancel
Save