Skip to content

Commit

Permalink
Add cluster name and uid as cluster controller identifier
Browse files Browse the repository at this point in the history
Signed-off-by: rasel <[email protected]>
  • Loading branch information
Superm4n97 committed Mar 7, 2024
1 parent 99401ab commit db4ce6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 1 addition & 13 deletions pkg/konnector/konnector_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit db4ce6f

Please sign in to comment.