From b4867d201f57d3500f784b618c99e820fd9ce5e8 Mon Sep 17 00:00:00 2001 From: Roberto Bonafiglia Date: Fri, 13 Sep 2024 11:00:48 +0200 Subject: [PATCH] Fixed windows CNI setup in case cni none is configured Signed-off-by: Roberto Bonafiglia --- pkg/pebinaryexecutor/pebinary.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/pebinaryexecutor/pebinary.go b/pkg/pebinaryexecutor/pebinary.go index 110447cfdf..db2a38a0b5 100644 --- a/pkg/pebinaryexecutor/pebinary.go +++ b/pkg/pebinaryexecutor/pebinary.go @@ -116,6 +116,9 @@ func (p *PEBinaryConfig) Bootstrap(ctx context.Context, nodeConfig *config.Node, return err } + // required to initialize KubeProxy + p.KubeConfigKubeProxy = nodeConfig.AgentConfig.KubeConfigKubeProxy + switch p.CNIName { case "", CNICalico: logrus.Info("Setting up Calico CNI") @@ -125,6 +128,7 @@ func (p *PEBinaryConfig) Bootstrap(ctx context.Context, nodeConfig *config.Node, p.CNIPlugin = &win.Flannel{} case CNINone: logrus.Info("Skipping CNI setup") + return nil default: logrus.Fatal("Unsupported CNI: ", p.CNIName) } @@ -133,9 +137,6 @@ func (p *PEBinaryConfig) Bootstrap(ctx context.Context, nodeConfig *config.Node, return err } - // required to initialize KubeProxy - p.KubeConfigKubeProxy = nodeConfig.AgentConfig.KubeConfigKubeProxy - logrus.Infof("Windows bootstrap okay. Exiting setup.") return nil }