Merge pull request #101250 from evertrain/master

Bugfix: prevent daemon controller to adopt controller revisions of ot…
This commit is contained in:
Kubernetes Prow Robot
2021-11-10 09:19:26 -08:00
committed by GitHub
5 changed files with 152 additions and 12 deletions

View File

@@ -107,6 +107,12 @@ func (m *BaseControllerRefManager) ClaimObject(ctx context.Context, obj metav1.O
// Ignore if the object is being deleted
return false, nil
}
if len(m.Controller.GetNamespace()) > 0 && m.Controller.GetNamespace() != obj.GetNamespace() {
// Ignore if namespace not match
return false, nil
}
// Selector matches. Try to adopt.
if err := adopt(ctx, obj); err != nil {
// If the pod no longer exists, ignore the error.