From 144393140218b30cf507d1539d089fa3de6dffa9 Mon Sep 17 00:00:00 2001 From: Subbarao Meduri Date: Thu, 14 Sep 2023 14:47:33 -0400 Subject: [PATCH] reset endpoint deployment node selectors and tolerations while creating manifests (#1244) Signed-off-by: Subbarao Meduri --- .../controllers/placementrule/manifestwork.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/operators/multiclusterobservability/controllers/placementrule/manifestwork.go b/operators/multiclusterobservability/controllers/placementrule/manifestwork.go index de2f896d8..4bcbfd958 100644 --- a/operators/multiclusterobservability/controllers/placementrule/manifestwork.go +++ b/operators/multiclusterobservability/controllers/placementrule/manifestwork.go @@ -304,6 +304,10 @@ func createManifestWorks(c client.Client, restMapper meta.RESTMapper, } else if clusterName == localClusterName { spec.NodeSelector = mco.Spec.NodeSelector spec.Tolerations = mco.Spec.Tolerations + } else { + // reset NodeSelector and Tolerations + spec.NodeSelector = map[string]string{} + spec.Tolerations = []corev1.Toleration{} } for i, container := range spec.Containers { if container.Name == "endpoint-observability-operator" { @@ -326,6 +330,8 @@ func createManifestWorks(c client.Client, restMapper meta.RESTMapper, } } } + log.Info(fmt.Sprintf("Cluster: %+v, Spec.NodeSelector (after): %+v", clusterName, spec.NodeSelector)) + log.Info(fmt.Sprintf("Cluster: %+v, Spec.Tolerations (after): %+v", clusterName, spec.Tolerations)) dep.Spec.Template.Spec = spec manifests = injectIntoWork(manifests, dep) // replace the pull secret and addon components image