diff --git a/pkg/controllers/resources/pods/translate/translator.go b/pkg/controllers/resources/pods/translate/translator.go index 644a0641a..a4caf5c91 100644 --- a/pkg/controllers/resources/pods/translate/translator.go +++ b/pkg/controllers/resources/pods/translate/translator.go @@ -911,6 +911,12 @@ func (t *translator) calcSpecDiff(pObj, vObj *corev1.Pod) *corev1.PodSpec { updatedPodSpec.InitContainers = updatedContainer } + schedulingGatesVal, equal := isPodSpecSchedulingGatesDiff(pObj.Spec.SchedulingGates, vObj.Spec.SchedulingGates) + if !equal { + updatedPodSpec = pObj.Spec.DeepCopy() + updatedPodSpec.SchedulingGates = schedulingGatesVal + } + return updatedPodSpec } @@ -959,3 +965,15 @@ func isInt64Different(i1, i2 *int64) (*int64, bool) { return updated, false } + +func isPodSpecSchedulingGatesDiff(pGates, vGates []corev1.PodSchedulingGate) ([]corev1.PodSchedulingGate, bool) { + if len(vGates) != len(pGates) { + return vGates, false + } + for i, v := range vGates { + if v.Name != pGates[i].Name { + return vGates, false + } + } + return vGates, true +}