Bugfix prevent daemon controller to adopt controller revisions of other namespaces

This commit is contained in:
evertrain
2021-11-01 17:36:15 +08:00
parent 37efc5feec
commit 9ceb226c06
5 changed files with 132 additions and 12 deletions

View File

@@ -225,6 +225,19 @@ func addFailedPods(podStore cache.Store, nodeName string, label map[string]strin
}
}
func newControllerRevision(name string, namespace string, label map[string]string,
ownerReferences []metav1.OwnerReference) *apps.ControllerRevision {
return &apps.ControllerRevision{
TypeMeta: metav1.TypeMeta{APIVersion: "apps/v1"},
ObjectMeta: metav1.ObjectMeta{
Name: name,
Labels: label,
Namespace: namespace,
OwnerReferences: ownerReferences,
},
}
}
type fakePodControl struct {
sync.Mutex
*controller.FakePodControl