From 2d8063b3005aaef0da7b0ba66f3e58f3f564af23 Mon Sep 17 00:00:00 2001 From: Vicente Cheng Date: Mon, 5 Aug 2024 11:11:17 +0800 Subject: [PATCH] controller/node: skip update vlanconfig with witness node - we did not apply any vlanconfig on the witness node, so we need to skip the vlanconfig update when witness node change. Signed-off-by: Vicente Cheng (cherry picked from commit 9ca1501c1cf87f9fe989d24893652c616a8dff12) --- pkg/controller/manager/node/controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/controller/manager/node/controller.go b/pkg/controller/manager/node/controller.go index 330af010c..ac2473ef9 100644 --- a/pkg/controller/manager/node/controller.go +++ b/pkg/controller/manager/node/controller.go @@ -61,6 +61,11 @@ func (h Handler) OnChange(_ string, node *corev1.Node) (*corev1.Node, error) { return nil, err } + // skip witness node because we do not allow vlan config on witness node + if node.Labels != nil && node.Labels[utils.HarvesterWitnessNodeLabelKey] == "true" { + return nil, nil + } + vcs, err := h.vcCache.List(labels.Everything()) if err != nil { return nil, err