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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set cluster name label for pre-existing kubeconfig #4833

Merged
merged 1 commit into from
May 14, 2024

Conversation

willie-yao
Copy link
Contributor

What type of PR is this?
/kind bug

What this PR does / why we need it:
This PR adds a fix for clusters upgrading from before CAPI v1.5 to a newer version. v1.5 introduced a new requirement for the ClusterNameLabel to be added to kubeconfig secrets: https://cluster-api.sigs.k8s.io/developer/providers/migrations/v1.4-to-v1.5#other

CAPZ handles this for newly created kubeconfigs, but not pre-existing ones. This PR handles that case.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #4738

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Set cluster name label for pre-existing kubeconfig

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 10, 2024
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 10, 2024
Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 62.00%. Comparing base (abba169) to head (d4fda95).
Report is 81 commits behind head on main.

Files Patch % Lines
controllers/azuremanagedcontrolplane_reconciler.go 0.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4833      +/-   ##
==========================================
- Coverage   62.62%   62.00%   -0.62%     
==========================================
  Files         198      201       +3     
  Lines       16285    16862     +577     
==========================================
+ Hits        10198    10455     +257     
- Misses       5341     5624     +283     
- Partials      746      783      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

It would be nice to cover this with a unit test, but I see there aren't any around Reconcile or reconcileKubeconfig yet. So that's probably too much to ask for this bug fix.

Thanks for fixing this @willie-yao!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 14, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f4336d27f3e9b7e28ed8afe42711456917398031

@mboersma
Copy link
Contributor

/assign @nojnhuh

Copy link
Contributor

@nojnhuh nojnhuh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thanks Willie!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nojnhuh

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 May 14, 2024
@k8s-ci-robot k8s-ci-robot merged commit 4b1d9c1 into kubernetes-sigs:main May 14, 2024
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.15 milestone May 14, 2024
@willie-yao
Copy link
Contributor Author

/cherry-pick release-1.14

@willie-yao
Copy link
Contributor Author

/cherry-pick release-1.13

@k8s-infra-cherrypick-robot

@willie-yao: new pull request created: #4846

In response to this:

/cherry-pick release-1.14

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-sigs/prow repository.

@k8s-infra-cherrypick-robot

@willie-yao: new pull request created: #4847

In response to this:

/cherry-pick release-1.13

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-sigs/prow repository.

@willie-yao
Copy link
Contributor Author

/cherry-pick release-1.15

@k8s-infra-cherrypick-robot

@willie-yao: new pull request created: #4848

In response to this:

/cherry-pick release-1.15

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-sigs/prow repository.

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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Archived in project
5 participants