Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Fixes logic to fetch credentials of remote cluster #1515

Merged
merged 1 commit into from
May 9, 2022

Conversation

aartij17
Copy link
Contributor

@aartij17 aartij17 commented Apr 13, 2022

What this PR does / why we need it:

  • Update the logic to get remote cluster config using the name of the CAPI cluster. This was working previously since there was an assumption that the name of the Cluster and VSphereCluster object is the same which has changed with the advent of ClusterClass.
  • Updates the provider service account and service discovery controllers to work with different names of cluster and infra cluster objects.

Which issue(s) this PR fixes :
Fixes #1514

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

Fixes logic to fetch credentials of remote cluster

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 13, 2022
@aartij17 aartij17 force-pushed the fix-secret-lookup branch 2 times, most recently from c5304dc to 12306fa Compare April 13, 2022 23:29
@srm09
Copy link
Contributor

srm09 commented Apr 19, 2022

/retest

@yastij
Copy link
Member

yastij commented Apr 25, 2022

/retest

Copy link
Member

@yastij yastij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/assign @srm09

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yastij

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 25, 2022
@srm09 srm09 added this to the v1.2.0 milestone Apr 25, 2022
@srm09
Copy link
Contributor

srm09 commented Apr 25, 2022

/retest

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 28, 2022
@srm09
Copy link
Contributor

srm09 commented Apr 28, 2022

/retitle Fixes logic to fetch credentials of remote cluster

@k8s-ci-robot k8s-ci-robot changed the title 馃悰 Fix clusterKey used to fetch workload cluster's kubeconfig Fixes logic to fetch credentials of remote cluster Apr 28, 2022
@srm09
Copy link
Contributor

srm09 commented Apr 28, 2022

/retitle 馃悰Fixes logic to fetch credentials of remote cluster

@k8s-ci-robot k8s-ci-robot changed the title Fixes logic to fetch credentials of remote cluster 馃悰Fixes logic to fetch credentials of remote cluster Apr 28, 2022
@srm09
Copy link
Contributor

srm09 commented Apr 28, 2022

/retitle 馃悰 Fixes logic to fetch credentials of remote cluster

@k8s-ci-robot k8s-ci-robot changed the title 馃悰Fixes logic to fetch credentials of remote cluster 馃悰 Fixes logic to fetch credentials of remote cluster Apr 28, 2022
The provider service account and service discovery controllers had an
inherent assumption that the names of the Cluster and VSphereCluster
object is the same. Hence the logic to fetch the secret containing the
kubeconfig of the guest cluster was leveraging the name of the
VSphereCluster object.
With the advent of ClusterClass, the name of the generated
VSphereCluster object is different than the name of the Cluster object.

This patch adds the logic to get the owner Cluster object from the
VSphereCluster object and use that to generate the name of the secret
that contains the kubeconfig.
It also updates the test logic by passing different name to the Cluster
object.

Signed-off-by: Sagar Muchhal <muchhals@vmware.com>
@aartij17
Copy link
Contributor Author

aartij17 commented May 9, 2022

/lgtm

@k8s-ci-robot
Copy link
Contributor

@aartij17: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@srm09
Copy link
Contributor

srm09 commented May 9, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 9, 2022
@k8s-ci-robot k8s-ci-robot merged commit 89338e0 into kubernetes-sigs:main May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service Discovery Controller looks up <vsphere-cluster>-kubeconfig secret which doesn't exist
4 participants