Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/resourcemerge/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func ensurePodSpec(modified *bool, existing *corev1.PodSpec, required corev1.Pod

setStringIfSet(modified, &existing.ServiceAccountName, required.ServiceAccountName)
setBool(modified, &existing.HostNetwork, required.HostNetwork)
setBoolPtr(modified, &existing.HostUsers, required.HostUsers)
mergeMap(modified, &existing.NodeSelector, required.NodeSelector)
ensurePodSecurityContextPtr(modified, &existing.SecurityContext, required.SecurityContext)
ensureAffinityPtr(modified, &existing.Affinity, required.Affinity)
Expand Down
11 changes: 11 additions & 0 deletions lib/resourcemerge/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ func TestEnsurePodSpec(t *testing.T) {
Containers: []corev1.Container{
{Name: "test"}}},
},
{
name: "hostUsers flag is set",
existing: corev1.PodSpec{},
input: corev1.PodSpec{
HostUsers: boolPtr(false),
},
expectedModified: true,
expected: corev1.PodSpec{
HostUsers: boolPtr(false),
},
},
{
name: "PodSecurityContext empty",
existing: corev1.PodSpec{
Expand Down