From 91e24e91752ff5b396b671ff7d28bdf07c3abe11 Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Mon, 6 Nov 2023 08:32:45 -0700 Subject: [PATCH] fix: use the node name instead of the hostname to build the injector pod (#2119) ## Description This sets the injector pod to use the node name instead of the hostname to more properly select the node it should run on. ## Related Issue Fixes #2110 ## Type of change - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [ ] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow) followed --- src/internal/cluster/injector.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/cluster/injector.go b/src/internal/cluster/injector.go index f89bfbf491..a472b18205 100644 --- a/src/internal/cluster/injector.go +++ b/src/internal/cluster/injector.go @@ -304,7 +304,7 @@ func (c *Cluster) buildInjectionPod(node, image string, payloadConfigmaps []stri pod.Labels[agentLabel] = "ignore" // Bind the pod to the node the image was found on - pod.Spec.NodeSelector = map[string]string{"kubernetes.io/hostname": node} + pod.Spec.NodeName = node // Do not try to restart the pod as it will be deleted/re-created instead pod.Spec.RestartPolicy = corev1.RestartPolicyNever