From 75fbf57296ad96fabd3a0592134e75f8484f4cdb Mon Sep 17 00:00:00 2001 From: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:44:47 +0200 Subject: [PATCH] fix host_ip env Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> --- .../controllers/placementrule/manifestwork.go | 10 ---------- .../manifests/endpoint-observability/operator.yaml | 4 ++++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/operators/multiclusterobservability/controllers/placementrule/manifestwork.go b/operators/multiclusterobservability/controllers/placementrule/manifestwork.go index 6401c66a64..0ca19672b5 100644 --- a/operators/multiclusterobservability/controllers/placementrule/manifestwork.go +++ b/operators/multiclusterobservability/controllers/placementrule/manifestwork.go @@ -409,16 +409,6 @@ func createManifestWorks( Value: "true", }) - // Add host ip env for endpoint operator. It is needed for microshift to scrape host processes metrics - spec.Containers[0].Env = append(spec.Containers[0].Env, corev1.EnvVar{ - Name: "HOST_IP", - ValueFrom: &corev1.EnvVarSource{ - FieldRef: &corev1.ObjectFieldSelector{ - FieldPath: "status.hostIP", - }, - }, - }) - dep.ObjectMeta.Name = config.HubEndpointOperatorName } diff --git a/operators/multiclusterobservability/manifests/endpoint-observability/operator.yaml b/operators/multiclusterobservability/manifests/endpoint-observability/operator.yaml index b35a1ac8c8..324c2fa71e 100644 --- a/operators/multiclusterobservability/manifests/endpoint-observability/operator.yaml +++ b/operators/multiclusterobservability/manifests/endpoint-observability/operator.yaml @@ -53,6 +53,10 @@ spec: value: "false" - name: PULL_SECRET value: "REPLACE_WITH_IMAGEPULLSECRET" + - name: HOST_IP # Needed for microshift + valueFrom: + fieldRef: + fieldPath: status.hostIP volumeMounts: - name: hub-kubeconfig-secret mountPath: "/spoke/hub-kubeconfig"