fix:group was updated continuously in member cluster
Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
@@ -146,7 +146,8 @@ func (c *Controller) reconcile(key string) error {
|
||||
}
|
||||
|
||||
if group.Labels != nil {
|
||||
// Set OwnerReferences when the group has a parent.
|
||||
// Set OwnerReferences when the group has a parent. And it's owned by kubefed
|
||||
if group.Labels[constants.KubefedManagedLabel] != "true" {
|
||||
if parent, ok := group.Labels[iam1alpha2.GroupParent]; ok && !k8sutil.IsControlledBy(group.OwnerReferences, "Group", parent) {
|
||||
if g == nil {
|
||||
g = group.DeepCopy()
|
||||
@@ -168,7 +169,7 @@ func (c *Controller) reconcile(key string) error {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if g != nil {
|
||||
if _, err = c.ksClient.IamV1alpha2().Groups().Update(context.Background(), g, metav1.UpdateOptions{}); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user