fix: Update RB once new clusters are added to trigger the propagation of service to these new clusters

Signed-off-by: jwcesign <jwcesign@gmail.com>
This commit is contained in:
jwcesign 2023-12-14 21:52:23 +08:00
parent 99447b01f7
commit f0bc661579
1 changed files with 0 additions and 9 deletions

View File

@ -418,16 +418,7 @@ func (c *MCSController) propagateService(ctx context.Context, mcs *networkingv1a
func (c *MCSController) buildResourceBinding(svc *corev1.Service, mcs *networkingv1alpha1.MultiClusterService,
providerClusters, consumerClusters sets.Set[string]) (*workv1alpha2.ResourceBinding, error) {
allClusters, err := util.GetClusterSet(c.Client)
if err != nil {
klog.Errorf("Failed to get all clusters:%v", err)
return nil, err
}
propagateClusters := providerClusters.Clone().Insert(consumerClusters.Clone().UnsortedList()...)
if propagateClusters.Equal(allClusters) {
propagateClusters = sets.Set[string]{}
}
placement := &policyv1alpha1.Placement{
ClusterAffinity: &policyv1alpha1.ClusterAffinity{
ClusterNames: propagateClusters.UnsortedList(),