bugfix: update Resource info when update attached binding

Signed-off-by: lihanbo <lihanbo2@huawei.com>
This commit is contained in:
lihanbo 2022-03-17 14:55:56 +08:00
parent 8843749bf2
commit f66e391ee7
1 changed files with 1 additions and 0 deletions

View File

@ -603,6 +603,7 @@ func (d *DependenciesDistributor) createOrUpdateAttachedBinding(attachedBinding
updatedBindingSnapshot := mergeBindingSnapshot(existBinding.Spec.RequiredBy, attachedBinding.Spec.RequiredBy)
existBinding.Spec.RequiredBy = updatedBindingSnapshot
existBinding.Labels = util.DedupeAndMergeLabels(existBinding.Labels, attachedBinding.Labels)
existBinding.Spec.Resource = attachedBinding.Spec.Resource
if err := d.Client.Update(context.TODO(), existBinding); err != nil {
klog.Errorf("failed to update resource binding(%s/%s): %v", existBinding.Namespace, existBinding.Name, err)