Skip to content

Commit ce6f582

Browse files
TomerNewmank8s-ci-robot
authored andcommitted
fixing HashAnnotationDiffer function
The NMC logic ensure we call this function in such a way we never fall into one of the 2 buggy `if` sections. That said, if the implementation were to change, we could hit this bug in real time, therefore, this method should be fixed.
1 parent f2f76d7 commit ce6f582

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/pod/workerpodmanager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ func (wpmi *workerPodManagerImpl) GetTolerationsAnnotation(p *v1.Pod) string {
304304
func (wpmi *workerPodManagerImpl) HashAnnotationDiffer(p1, p2 *v1.Pod) bool {
305305

306306
if p1 == nil && p2 == nil {
307-
return true
307+
return false
308308
}
309309

310310
if (p1 == nil && p2 != nil) || (p1 != nil) && (p2 == nil) {
311-
return false
311+
return true
312312
}
313313

314314
return p1.Annotations[hashAnnotationKey] != p2.Annotations[hashAnnotationKey]

0 commit comments

Comments
 (0)