Skip to content

Check for VM assigned identities without API calls #5780

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

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

nojnhuh
Copy link
Contributor

@nojnhuh nojnhuh commented Jul 23, 2025

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

This PR removes the need to perform an extra API call for every reconciliation of every VM to determine whether the user assigned identities defined in an AzureMachine exist on the VM in Azure.

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

Special notes for your reviewer:

I did manually test that this still works as expected:

  • Create a cluster where at least one AzureMachine defines a user-assigned identity (e.g. the control plane nodes in the default flavor)
  • In the portal, remove the identity from the VM
  • Wait for or trigger a reconciliation of the AzureMachine (e.g. kubectl label)
  • Observe the VMIdentitiesReady condition appear on the AzureMachine with UserAssignedIdentityMissing

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • cherry-pick candidate

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Jul 23, 2025
@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 23, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 23, 2025
@nojnhuh
Copy link
Contributor Author

nojnhuh commented Jul 23, 2025

We should make this available to scalability tests when we pin that to a release branch of CAPZ:

/cherry-pick release-1.20

@k8s-infra-cherrypick-robot

@nojnhuh: once the present PR merges, I will cherry-pick it on top of release-1.20 in a new PR and assign it to you.

In response to this:

We should make this available to scalability tests when we pin that to a release branch of CAPZ:

/cherry-pick release-1.20

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.

Copy link

codecov bot commented Jul 23, 2025

Codecov Report

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

Project coverage is 52.81%. Comparing base (9ad724c) to head (5791ee2).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
azure/converters/vm.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5780      +/-   ##
==========================================
- Coverage   52.82%   52.81%   -0.02%     
==========================================
  Files         279      279              
  Lines       29629    29602      -27     
==========================================
- Hits        15652    15634      -18     
+ Misses      13160    13154       -6     
+ Partials      817      814       -3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@willie-yao willie-yao 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

Good find! Not sure why I thought it was necessary to build a map of expected identities when we already had them lol

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

LGTM label has been added.

Git tree hash: 80d84ed26f6e4e7e1345e43e8b36488b4717cede

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: willie-yao

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 Jul 23, 2025
@jackfrancis jackfrancis merged commit 5605fb5 into kubernetes-sigs:main Jul 23, 2025
18 of 22 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Jul 23, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in CAPZ Planning Jul 23, 2025
@k8s-infra-cherrypick-robot

@nojnhuh: new pull request created: #5782

In response to this:

We should make this available to scalability tests when we pin that to a release branch of CAPZ:

/cherry-pick release-1.20

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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants