From fdd39fbdd468c16e4983639cf02c37857084e65e 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 059b90a6e6..4e9dc76089 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 }