Skip to content

Commit 5590df6

Browse files
committed
Override instead of replace
1 parent 43e955b commit 5590df6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/webhooks/fsGroupChangePolicySetter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ func (a *FsGroupChangePolicySetter) Handle(ctx context.Context, req admission.Re
7474
tsc.WhenUnsatisfiable = v1.DoNotSchedule
7575
}
7676

77-
// add our topology spread constraints
78-
pod.Spec.TopologySpreadConstraints = append(pod.Spec.TopologySpreadConstraints, tsc)
77+
// override topology spread constraints
78+
pod.Spec.TopologySpreadConstraints = []v1.TopologySpreadConstraint{tsc}
7979
log.V(1).Info("Mutating Pod topologySpreadConstraints", "topologySpreadConstraints", pod.Spec.TopologySpreadConstraints)
8080
}
8181

0 commit comments

Comments
 (0)