Skip to content

Commit

Permalink
fix: use the node name instead of the hostname to build the injector …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Racer159 authored Nov 6, 2023
1 parent 6c2157a commit 91e24e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/internal/cluster/injector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 91e24e9

Please sign in to comment.