diff --git a/pkg/konnector/controllers/cluster/clusterbinding/clusterbinding_reconcile.go b/pkg/konnector/controllers/cluster/clusterbinding/clusterbinding_reconcile.go index 8ed014a6..7bb520be 100644 --- a/pkg/konnector/controllers/cluster/clusterbinding/clusterbinding_reconcile.go +++ b/pkg/konnector/controllers/cluster/clusterbinding/clusterbinding_reconcile.go @@ -94,6 +94,7 @@ func (r *reconciler) ensureRightScopedServiceBinding(ctx context.Context, bindin sb.Spec.Providers[i].ClusterUID = binding.Status.Provider.ClusterUID sb.Spec.Providers[i].ClusterName = binding.Status.Provider.ClusterName if err = r.updateServiceBinding(ctx, &sb); err != nil { + klog.Errorf(err.Error()) return err } break diff --git a/pkg/konnector/konnector_reconcile.go b/pkg/konnector/konnector_reconcile.go index f0198a6f..7cca8240 100644 --- a/pkg/konnector/konnector_reconcile.go +++ b/pkg/konnector/konnector_reconcile.go @@ -69,7 +69,7 @@ func (r *reconciler) reconcile(ctx context.Context, binding *kubebindv1alpha1.AP } else if errors.IsNotFound(err) { logger.V(2).Info("secret not found", "secret", p.Kubeconfig.Namespace+"/"+p.Kubeconfig.Name) } else { - kubeconfigs = append(kubeconfigs, string(secret.Data[p.Kubeconfig.Key])) + kubeconfigs = append(kubeconfigs, string(secret.Data[p.Kubeconfig.Key])+p.ClusterName+p.ClusterUID) idf := providerIdentifier{ kubeconfig: string(secret.Data[p.Kubeconfig.Key]), secretRefName: p.Kubeconfig.Name, @@ -141,18 +141,6 @@ func (r *reconciler) reconcile(ctx context.Context, binding *kubebindv1alpha1.AP } provider.ConsumerSecretRefKey = identifier.secretRefNamespace + "/" + identifier.secretRefName - // set cluster uid - //kubeclient, err := kubernetesclient.NewForConfig(provider.Config) - //if err != nil { - // return err - //} - //ns, err := kubeclient.CoreV1().Namespaces().Get(ctx, namespaceKubeSystem, metav1.GetOptions{}) - //if err != nil { - // klog.Error(err.Error()) - // return err - //} - //provider.ClusterID = string(ns.GetUID()) - provider.ClusterID = identifier.clusterUID providerInfos = append(providerInfos, &provider)