Merge pull request #4423 from jwcesign/fix-pp-conflict-v3

fix: Update RB once new clusters are added to trigger the propagation of service to these new clusters
This commit is contained in:
karmada-bot 2023-12-15 10:20:11 +08:00 committed by GitHub
commit f7b6e79054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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(),