Repository: clusternet/clusternet
Pull request #221 (2021-12-23 14:06:23)

use namespaced cluster name in binding
Signed-off-by: Di Xu <stephenhsu90@gmail.com>

<!--  Thanks for sending a pull request!

-->

#### What type of PR is this?

#### What this PR does / why we need it:
a follow up fix of PR #217 

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:


codecov-commenter: # [Codecov](https://codecov.io/gh/clusternet/clusternet/pull/221?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet) Report
> Merging [#221](https://codecov.io/gh/clusternet/clusternet/pull/221?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet) (f4c0086) into [main](https://codecov.io/gh/clusternet/clusternet/commit/3b10168f334e9cc05d48007ddaad3e6b7253ae9c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet) (3b10168) will **increase** coverage by `0.07%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/clusternet/clusternet/pull/221/graphs/tree.svg?width=650&height=150&src=pr&token=4O6PTR0RJN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet)](https://codecov.io/gh/clusternet/clusternet/pull/221?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet)

```diff
@@            Coverage Diff             @@
##             main     #221      +/-   ##
==========================================
+ Coverage   10.19%   10.26%   +0.07%     
==========================================
  Files          39       39              
  Lines        4236     4236              
==========================================
+ Hits          432      435       +3     
+ Misses       3772     3770       -2     
+ Partials       32       31       -1     
```


| [Impacted Files](https://codecov.io/gh/clusternet/clusternet/pull/221?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet) | Coverage Δ | |
|---|---|---|
| [...ernet/clusternet/pkg/hub/apiserver/shadow/utils.go](https://codecov.io/gh/clusternet/clusternet/pull/221/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet#diff-c3JjL2dpdGh1Yi5jb20vY2x1c3Rlcm5ldC9jbHVzdGVybmV0L3BrZy9odWIvYXBpc2VydmVyL3NoYWRvdy91dGlscy5nbw==) | `100.00% <0.00%> (+10.71%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/clusternet/clusternet/pull/221?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/clusternet/clusternet/pull/221?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet). Last update [3b10168...f4c0086](https://codecov.io/gh/clusternet/clusternet/pull/221?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clusternet).


Patch:
diff --git a/manifests/crds/apps.clusternet.io_subscriptions.yaml b/manifests/crds/apps.clusternet.io_subscriptions.yaml
index 6e01599..b7f05e1 100644
--- a/manifests/crds/apps.clusternet.io_subscriptions.yaml
+++ b/manifests/crds/apps.clusternet.io_subscriptions.yaml
@@ -144,8 +144,8 @@ spec:
           status:
             description: SubscriptionStatus defines the observed state of Subscription
             properties:
-              bindingNamespaces:
-                description: Namespaces of targeted clusters that Subscription binds to.
+              bindingClusters:
+                description: Namespaced names of targeted clusters that Subscription binds to.
                 items:
                   type: string
                 type: array
diff --git a/pkg/apis/apps/v1alpha1/subscription.go b/pkg/apis/apps/v1alpha1/subscription.go
index b7ddb35..53ee3f3 100644
--- a/pkg/apis/apps/v1alpha1/subscription.go
+++ b/pkg/apis/apps/v1alpha1/subscription.go
@@ -76,10 +76,10 @@ type SubscriptionSpec struct {
 
 // SubscriptionStatus defines the observed state of Subscription
 type SubscriptionStatus struct {
-	// Namespaces of targeted clusters that Subscription binds to.
+	// Namespaced names of targeted clusters that Subscription binds to.
 	//
 	// +optional
-	BindingNamespaces []string `json:"bindingNamespaces,omitempty"`
+	BindingClusters []string `json:"bindingClusters,omitempty"`
 
 	// SpecHash calculates the hash value of current SubscriptionSpec.
 	//
diff --git a/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go
index 0db01bf..64b5d97 100644
--- a/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go
@@ -833,8 +833,8 @@ func (in *SubscriptionSpec) DeepCopy() *SubscriptionSpec {
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *SubscriptionStatus) DeepCopyInto(out *SubscriptionStatus) {
 	*out = *in
-	if in.BindingNamespaces != nil {
-		in, out := &in.BindingNamespaces, &out.BindingNamespaces
+	if in.BindingClusters != nil {
+		in, out := &in.BindingClusters, &out.BindingClusters
 		*out = make([]string, len(*in))
 		copy(*out, *in)
 	}
diff --git a/pkg/controllers/apps/subscription/subscription.go b/pkg/controllers/apps/subscription/subscription.go
index 0aaca9d..0f7656c 100644
--- a/pkg/controllers/apps/subscription/subscription.go
+++ b/pkg/controllers/apps/subscription/subscription.go
@@ -152,7 +152,7 @@ func (c *Controller) updateSubscription(old, cur interface{}) {
 		return
 	}
 	// no changes on binding namespaces and spec hash
-	if reflect.DeepEqual(oldSub.Status.BindingNamespaces, newSub.Status.BindingNamespaces) &&
+	if reflect.DeepEqual(oldSub.Status.BindingClusters, newSub.Status.BindingClusters) &&
 		oldSub.Status.SpecHash == newSub.Status.SpecHash {
 		klog.V(4).Infof("no changes on binding namespaces and spec hash of Subscription %s, skipping syncing", klog.KObj(oldSub))
 		return
diff --git a/pkg/hub/deployer/deployer.go b/pkg/hub/deployer/deployer.go
index 03d7423..dedb364 100644
--- a/pkg/hub/deployer/deployer.go
+++ b/pkg/hub/deployer/deployer.go
@@ -278,14 +278,14 @@ func (deployer *Deployer) handleSubscription(sub *appsapi.Subscription) error {
 }
 
 func (deployer *Deployer) populateBases(sub *appsapi.Subscription) error {
-	allExistingBases, err := deployer.baseLister.List(labels.SelectorFromSet(labels.Set{
+	allExistingBases, listErr := deployer.baseLister.List(labels.SelectorFromSet(labels.Set{
 		known.ConfigKindLabel:      subscriptionKind.Kind,
 		known.ConfigNameLabel:      sub.Name,
 		known.ConfigNamespaceLabel: sub.Namespace,
 		known.ConfigUIDLabel:       string(sub.UID),
 	}))
-	if err != nil {
-		return err
+	if listErr != nil {
+		return listErr
 	}
 	// Bases to be deleted
 	basesToBeDeleted := sets.String{}
@@ -294,7 +294,14 @@ func (deployer *Deployer) populateBases(sub *appsapi.Subscription) error {
 	}
 
 	var allErrs []error
-	for _, namespace := range sub.Status.BindingNamespaces {
+	for _, namespacedName := range sub.Status.BindingClusters {
+		// Convert the namespacedName/name string into a distinct namespacedName and name
+		namespace, _, err := cache.SplitMetaNamespaceKey(namespacedName)
+		if err != nil {
+			allErrs = append(allErrs, fmt.Errorf("invalid resource key: %s", namespacedName))
+			continue
+		}
+
 		ns, listErr := deployer.nsLister.Get(namespace)
 		if listErr != nil {
 			if apierrors.IsNotFound(listErr) {
@@ -332,7 +339,7 @@ func (deployer *Deployer) populateBases(sub *appsapi.Subscription) error {
 			base.Labels[known.ClusterNameLabel] = ns.Labels[known.ClusterNameLabel]
 		}
 
-		err := deployer.syncBase(sub, base)
+		err = deployer.syncBase(sub, base)
 		if err != nil {
 			allErrs = append(allErrs, err)
 			msg := fmt.Sprintf("Failed to sync Base %s: %v", klog.KObj(base), err)
diff --git a/pkg/scheduler/framework/interfaces/interface.go b/pkg/scheduler/framework/interfaces/interface.go
index 5c361eb..12281cd 100644
--- a/pkg/scheduler/framework/interfaces/interface.go
+++ b/pkg/scheduler/framework/interfaces/interface.go
@@ -233,7 +233,7 @@ type PreBindPlugin interface {
 
 	// PreBind is called before binding a subscription. All prebind plugins must return
 	// success or the subscription will be rejected and won't be sent for binding.
-	PreBind(ctx context.Context, sub *appsapi.Subscription, clusterNamespaces []string) *Status
+	PreBind(ctx context.Context, sub *appsapi.Subscription, namespacedClusters []string) *Status
 }
 
 // PostBindPlugin is an interface that must be implemented by "PostBind" plugins.
diff --git a/pkg/scheduler/framework/plugins/defaultbinder/default_binder.go b/pkg/scheduler/framework/plugins/defaultbinder/default_binder.go
index eecd3e4..3332fff 100644
--- a/pkg/scheduler/framework/plugins/defaultbinder/default_binder.go
+++ b/pkg/scheduler/framework/plugins/defaultbinder/default_binder.go
@@ -58,7 +58,7 @@ func (pl *DefaultBinder) Bind(ctx context.Context, sub *appsapi.Subscription, na
 	})
 
 	subCopy := sub.DeepCopy()
-	subCopy.Status.BindingNamespaces = namespacedClusters
+	subCopy.Status.BindingClusters = namespacedClusters
 	subCopy.Status.SpecHash = utils.HashSubscriptionSpec(&subCopy.Spec)
 	subCopy.Status.DesiredReleases = len(namespacedClusters)
 
diff --git a/pkg/scheduler/framework/runtime/framework.go b/pkg/scheduler/framework/runtime/framework.go
index edfdbdc..f686afa 100644
--- a/pkg/scheduler/framework/runtime/framework.go
+++ b/pkg/scheduler/framework/runtime/framework.go
@@ -476,13 +476,13 @@ func (f *frameworkImpl) runScoreExtension(ctx context.Context, pl framework.Scor
 // RunPreBindPlugins runs the set of configured prebind plugins. It returns a
 // failure (bool) if any of the plugins returns an error. It also returns an
 // error containing the rejection message or the error occurred in the plugin.
-func (f *frameworkImpl) RunPreBindPlugins(ctx context.Context, sub *appsapi.Subscription, clusterNamespaces []string) (status *framework.Status) {
+func (f *frameworkImpl) RunPreBindPlugins(ctx context.Context, sub *appsapi.Subscription, namespacedClusters []string) (status *framework.Status) {
 	startTime := time.Now()
 	defer func() {
 		metrics.FrameworkExtensionPointDuration.WithLabelValues(preBind, status.Code().String(), f.profileName).Observe(metrics.SinceInSeconds(startTime))
 	}()
 	for _, pl := range f.preBindPlugins {
-		status = f.runPreBindPlugin(ctx, pl, sub, clusterNamespaces)
+		status = f.runPreBindPlugin(ctx, pl, sub, namespacedClusters)
 		if !status.IsSuccess() {
 			err := status.AsError()
 			klog.ErrorS(err, "Failed running PreBind plugin", "plugin", pl.Name(), "sub", klog.KObj(sub))
@@ -492,15 +492,15 @@ func (f *frameworkImpl) RunPreBindPlugins(ctx context.Context, sub *appsapi.Subs
 	return nil
 }
 
-func (f *frameworkImpl) runPreBindPlugin(ctx context.Context, pl framework.PreBindPlugin, sub *appsapi.Subscription, clusterNamespaces []string) *framework.Status {
+func (f *frameworkImpl) runPreBindPlugin(ctx context.Context, pl framework.PreBindPlugin, sub *appsapi.Subscription, namespacedClusters []string) *framework.Status {
 	startTime := time.Now()
-	status := pl.PreBind(ctx, sub, clusterNamespaces)
+	status := pl.PreBind(ctx, sub, namespacedClusters)
 	f.metricsRecorder.observePluginDurationAsync(preBind, pl.Name(), status, metrics.SinceInSeconds(startTime))
 	return status
 }
 
 // RunBindPlugins runs the set of configured bind plugins until one returns a non `Skip` status.
-func (f *frameworkImpl) RunBindPlugins(ctx context.Context, sub *appsapi.Subscription, clusterNamespaces []string) (status *framework.Status) {
+func (f *frameworkImpl) RunBindPlugins(ctx context.Context, sub *appsapi.Subscription, namespacedClusters []string) (status *framework.Status) {
 	startTime := time.Now()
 	defer func() {
 		metrics.FrameworkExtensionPointDuration.WithLabelValues(bind, status.Code().String(), f.profileName).Observe(metrics.SinceInSeconds(startTime))
@@ -509,7 +509,7 @@ func (f *frameworkImpl) RunBindPlugins(ctx context.Context, sub *appsapi.Subscri
 		return framework.NewStatus(framework.Skip, "")
 	}
 	for _, bp := range f.bindPlugins {
-		status = f.runBindPlugin(ctx, bp, sub, clusterNamespaces)
+		status = f.runBindPlugin(ctx, bp, sub, namespacedClusters)
 		if status != nil && status.Code() == framework.Skip {
 			continue
 		}
@@ -523,27 +523,27 @@ func (f *frameworkImpl) RunBindPlugins(ctx context.Context, sub *appsapi.Subscri
 	return status
 }
 
-func (f *frameworkImpl) runBindPlugin(ctx context.Context, bp framework.BindPlugin, sub *appsapi.Subscription, clusterNamespaces []string) *framework.Status {
+func (f *frameworkImpl) runBindPlugin(ctx context.Context, bp framework.BindPlugin, sub *appsapi.Subscription, namespacedClusters []string) *framework.Status {
 	startTime := time.Now()
-	status := bp.Bind(ctx, sub, clusterNamespaces)
+	status := bp.Bind(ctx, sub, namespacedClusters)
 	f.metricsRecorder.observePluginDurationAsync(bind, bp.Name(), status, metrics.SinceInSeconds(startTime))
 	return status
 }
 
 // RunPostBindPlugins runs the set of configured postbind plugins.
-func (f *frameworkImpl) RunPostBindPlugins(ctx context.Context, sub *appsapi.Subscription, clusterNamespaces []string) {
+func (f *frameworkImpl) RunPostBindPlugins(ctx context.Context, sub *appsapi.Subscription, namespacedClusters []string) {
 	startTime := time.Now()
 	defer func() {
 		metrics.FrameworkExtensionPointDuration.WithLabelValues(postBind, framework.Success.String(), f.profileName).Observe(metrics.SinceInSeconds(startTime))
 	}()
 	for _, pl := range f.postBindPlugins {
-		f.runPostBindPlugin(ctx, pl, sub, clusterNamespaces)
+		f.runPostBindPlugin(ctx, pl, sub, namespacedClusters)
 	}
 }
 
-func (f *frameworkImpl) runPostBindPlugin(ctx context.Context, pl framework.PostBindPlugin, sub *appsapi.Subscription, clusterNamespaces []string) {
+func (f *frameworkImpl) runPostBindPlugin(ctx context.Context, pl framework.PostBindPlugin, sub *appsapi.Subscription, namespacedClusters []string) {
 	startTime := time.Now()
-	pl.PostBind(ctx, sub, clusterNamespaces)
+	pl.PostBind(ctx, sub, namespacedClusters)
 	f.metricsRecorder.observePluginDurationAsync(postBind, pl.Name(), nil, metrics.SinceInSeconds(startTime))
 }
 
@@ -552,13 +552,13 @@ func (f *frameworkImpl) runPostBindPlugin(ctx context.Context, pl framework.Post
 // continue running the remaining ones and returns the error. In such a case,
 // the subscription will not be scheduled and the caller will be expected to call
 // RunReservePluginsUnreserve.
-func (f *frameworkImpl) RunReservePluginsReserve(ctx context.Context, sub *appsapi.Subscription, clusterNamespaces []string) (status *framework.Status) {
+func (f *frameworkImpl) RunReservePluginsReserve(ctx context.Context, sub *appsapi.Subscription, namespacedClusters []string) (status *framework.Status) {
 	startTime := time.Now()
 	defer func() {
 		metrics.FrameworkExtensionPointDuration.WithLabelValues(reserve, status.Code().String(), f.profileName).Observe(metrics.SinceInSeconds(startTime))
 	}()
 	for _, pl := range f.reservePlugins {
-		status = f.runReservePluginReserve(ctx, pl, sub, clusterNamespaces)
+		status = f.runReservePluginReserve(ctx, pl, sub, namespacedClusters)
 		if !status.IsSuccess() {
 			err := status.AsError()
 			klog.ErrorS(err, "Failed running Reserve plugin", "plugin", pl.Name(), "subscription", klog.KObj(sub))
@@ -568,16 +568,16 @@ func (f *frameworkImpl) RunReservePluginsReserve(ctx context.Context, sub *appsa
 	return nil
 }
 
-func (f *frameworkImpl) runReservePluginReserve(ctx context.Context, pl framework.ReservePlugin, sub *appsapi.Subscription, clusterNamespaces []string) *framework.Status {
+func (f *frameworkImpl) runReservePluginReserve(ctx context.Context, pl framework.ReservePlugin, sub *appsapi.Subscription, namespacedClusters []string) *framework.Status {
 	startTime := time.Now()
-	status := pl.Reserve(ctx, sub, clusterNamespaces)
+	status := pl.Reserve(ctx, sub, namespacedClusters)
 	f.metricsRecorder.observePluginDurationAsync(reserve, pl.Name(), status, metrics.SinceInSeconds(startTime))
 	return status
 }
 
 // RunReservePluginsUnreserve runs the Unreserve method in the set of
 // configured reserve plugins.
-func (f *frameworkImpl) RunReservePluginsUnreserve(ctx context.Context, sub *appsapi.Subscription, clusterNamespaces []string) {
+func (f *frameworkImpl) RunReservePluginsUnreserve(ctx context.Context, sub *appsapi.Subscription, namespacedClusters []string) {
 	startTime := time.Now()
 	defer func() {
 		metrics.FrameworkExtensionPointDuration.WithLabelValues(unreserve, framework.Success.String(), f.profileName).Observe(metrics.SinceInSeconds(startTime))
@@ -585,13 +585,13 @@ func (f *frameworkImpl) RunReservePluginsUnreserve(ctx context.Context, sub *app
 	// Execute the Unreserve operation of each reserve plugin in the
 	// *reverse* order in which the Reserve operation was executed.
 	for i := len(f.reservePlugins) - 1; i >= 0; i-- {
-		f.runReservePluginUnreserve(ctx, f.reservePlugins[i], sub, clusterNamespaces)
+		f.runReservePluginUnreserve(ctx, f.reservePlugins[i], sub, namespacedClusters)
 	}
 }
 
-func (f *frameworkImpl) runReservePluginUnreserve(ctx context.Context, pl framework.ReservePlugin, sub *appsapi.Subscription, clusterNamespaces []string) {
+func (f *frameworkImpl) runReservePluginUnreserve(ctx context.Context, pl framework.ReservePlugin, sub *appsapi.Subscription, namespacedClusters []string) {
 	startTime := time.Now()
-	pl.Unreserve(ctx, sub, clusterNamespaces)
+	pl.Unreserve(ctx, sub, namespacedClusters)
 	f.metricsRecorder.observePluginDurationAsync(unreserve, pl.Name(), nil, metrics.SinceInSeconds(startTime))
 }
 
@@ -601,7 +601,7 @@ func (f *frameworkImpl) runReservePluginUnreserve(ctx context.Context, pl framew
 // plugins returns "Wait", then this function will create and add waiting subscription
 // to a map of currently waiting subs and return status with "Wait" code.
 // Subscription will remain waiting subscription for the minimum duration returned by the permit plugins.
-func (f *frameworkImpl) RunPermitPlugins(ctx context.Context, sub *appsapi.Subscription, clusterNamespaces []string) (status *framework.Status) {
+func (f *frameworkImpl) RunPermitPlugins(ctx context.Context, sub *appsapi.Subscription, namespacedClusters []string) (status *framework.Status) {
 	startTime := time.Now()
 	defer func() {
 		metrics.FrameworkExtensionPointDuration.WithLabelValues(permit, status.Code().String(), f.profileName).Observe(metrics.SinceInSeconds(startTime))
@@ -609,7 +609,7 @@ func (f *frameworkImpl) RunPermitPlugins(ctx context.Context, sub *appsapi.Subsc
 	pluginsWaitTime := make(map[string]time.Duration)
 	statusCode := framework.Success
 	for _, pl := range f.permitPlugins {
-		status, timeout := f.runPermitPlugin(ctx, pl, sub, clusterNamespaces)
+		status, timeout := f.runPermitPlugin(ctx, pl, sub, namespacedClusters)
 		if !status.IsSuccess() {
 			if status.IsUnschedulable() {
 				msg := fmt.Sprintf("rejected subscription %q by permit plugin %q: %v", sub.Name, pl.Name(), status.Message())
@@ -641,9 +641,9 @@ func (f *frameworkImpl) RunPermitPlugins(ctx context.Context, sub *appsapi.Subsc
 	return nil
 }
 
-func (f *frameworkImpl) runPermitPlugin(ctx context.Context, pl framework.PermitPlugin, sub *appsapi.Subscription, clusterNamespaces []string) (*framework.Status, time.Duration) {
+func (f *frameworkImpl) runPermitPlugin(ctx context.Context, pl framework.PermitPlugin, sub *appsapi.Subscription, namespacedClusters []string) (*framework.Status, time.Duration) {
 	startTime := time.Now()
-	status, timeout := pl.Permit(ctx, sub, clusterNamespaces)
+	status, timeout := pl.Permit(ctx, sub, namespacedClusters)
 	f.metricsRecorder.observePluginDurationAsync(permit, pl.Name(), status, metrics.SinceInSeconds(startTime))
 	return status, timeout
 }
diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go
index 7369ad6..a86606a 100644
--- a/pkg/scheduler/scheduler.go
+++ b/pkg/scheduler/scheduler.go
@@ -324,7 +324,7 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
 
 // bind a subscription to given clusters.
 // We expect this to run asynchronously, so we handle binding metrics internally.
-func (sched *Scheduler) bind(ctx context.Context, sub *appsapi.Subscription, targetClusterNamespaces []string) (err error) {
+func (sched *Scheduler) bind(ctx context.Context, sub *appsapi.Subscription, namespacedClusters []string) (err error) {
 	defer func() {
 		// finish binding
 		if err != nil {
@@ -336,11 +336,11 @@ func (sched *Scheduler) bind(ctx context.Context, sub *appsapi.Subscription, tar
 			corev1.EventTypeNormal,
 			"Scheduled",
 			"Binding",
-			"Successfully assigned %s to %s", klog.KObj(sub), strings.Join(targetClusterNamespaces, ","),
+			fmt.Sprintf("Successfully assigned %s to %s", klog.KObj(sub), strings.Join(namespacedClusters, ",")),
 		)
 	}()
 
-	bindStatus := sched.framework.RunBindPlugins(ctx, sub, targetClusterNamespaces)
+	bindStatus := sched.framework.RunBindPlugins(ctx, sub, namespacedClusters)
 	if bindStatus.IsSuccess() {
 		return nil
 	}


Test patch:
diff --git a/pkg/scheduler/framework/plugins/defaultbinder/default_binder_test.go b/pkg/scheduler/framework/plugins/defaultbinder/default_binder_test.go
index d58efa1..453c474 100644
--- a/pkg/scheduler/framework/plugins/defaultbinder/default_binder_test.go
+++ b/pkg/scheduler/framework/plugins/defaultbinder/default_binder_test.go
@@ -36,8 +36,8 @@ func TestDefaultBinder(t *testing.T) {
 		ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "ns"},
 	}
 	testClusters := []string{
-		"cluster-ns-03",
-		"cluster-ns-01",
+		"cluster-ns-03/xyz",
+		"cluster-ns-01/def",
 	}
 	tests := []struct {
 		name           string
@@ -47,8 +47,8 @@ func TestDefaultBinder(t *testing.T) {
 		{
 			name: "successful",
 			wantedBindings: []string{
-				"cluster-ns-01",
-				"cluster-ns-03",
+				"cluster-ns-01/def",
+				"cluster-ns-03/xyz",
 			},
 		}, {
 			name:      "binding error",
@@ -57,7 +57,7 @@ func TestDefaultBinder(t *testing.T) {
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			var bindedNamespaces []string
+			var bindedClusters []string
 			client := fake.NewSimpleClientset(testSubscription)
 			client.PrependReactor("update", "subscriptions", func(action clienttesting.Action) (bool, runtime.Object, error) {
 				if action.GetSubresource() != "status" {
@@ -69,7 +69,7 @@ func TestDefaultBinder(t *testing.T) {
 
 				bindedSubscription := action.(clienttesting.UpdateAction).GetObject().(*appsapi.Subscription)
 				if bindedSubscription != nil {
-					bindedNamespaces = bindedSubscription.Status.BindingNamespaces
+					bindedClusters = bindedSubscription.Status.BindingClusters
 				}
 				return true, bindedSubscription, nil
 			})
@@ -83,7 +83,7 @@ func TestDefaultBinder(t *testing.T) {
 			if got := status.AsError(); (tt.injectErr != nil) != (got != nil) {
 				t.Errorf("got error %q, want %q", got, tt.injectErr)
 			}
-			if diff := cmp.Diff(tt.wantedBindings, bindedNamespaces); diff != "" {
+			if diff := cmp.Diff(tt.wantedBindings, bindedClusters); diff != "" {
 				t.Errorf("got different binding (-want, +got): %s", diff)
 			}
 		})