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

Fix panic for GetZoneByNodeName on Azure Stack #8755

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

patrickdillon
Copy link
Contributor

What type of PR is this?

/kind bug
/kind regression

What this PR does / why we need it:

Azure Stack does not support the API Version, 2020-12-01, for PlatformFaultDomain, and therefore panics when we run the cloud provider on Azure Stack. This avoids the panic and sets the default fault domain.

Which issue(s) this PR fixes:

Fixes #8754

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


Azure Stack does not support the API Version, 2020-12-01, for
PlatformFaultDomain, and therefore panics when we run the cloud
provider on Azure Stack. This avoids the panic, but we cannot
get the correct PlatformFaultDomain (which may not be an issue).
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 27, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @patrickdillon!

It looks like this is your first PR to kubernetes-sigs/cloud-provider-azure 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cloud-provider-azure has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 27, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @patrickdillon. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-ci-robot k8s-ci-robot requested review from mainred and nilo19 March 27, 2025 18:58
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 27, 2025
@nrb
Copy link

nrb commented Mar 27, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 27, 2025
@nrb
Copy link

nrb commented Mar 27, 2025

/lgtm

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

nilo19 commented Mar 28, 2025

Thanks for the fix. Can you help add the unit tests?

@MartinForReal
Copy link
Contributor

/cherrypick release-1.32

@k8s-infra-cherrypick-robot

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

In response to this:

/cherrypick release-1.32

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.

@MartinForReal
Copy link
Contributor

/cherrypick release-1.31

@k8s-infra-cherrypick-robot

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

In response to this:

/cherrypick release-1.31

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.

@MartinForReal
Copy link
Contributor

/cherrypick release-1.30

@k8s-infra-cherrypick-robot

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

In response to this:

/cherrypick release-1.30

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.

@MartinForReal
Copy link
Contributor

/cherrypick release-1.29

@k8s-infra-cherrypick-robot

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

In response to this:

/cherrypick release-1.29

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.

@patrickdillon
Copy link
Contributor Author

Yes I will add unit tests, and we may need additional changes as the CSI driver is also failing in azure stack.

@MartinForReal @nilo19 do you understand the problem here, particularly why would InstanceView be nil?

PlatformFaultDomain in vm properties states that it requires a minimal API version incompatible with Azure Stack, but I would not necessarily expect InstanceView to be nil, so I was not certain this is the right fix:

I find understanding the supported API versions with Azure Stack to be very challenging

@feiskyer
Copy link
Member

I find understanding the supported API versions with Azure Stack to be very challenging

@patrickdillon are you able to build an image with this change and validate on your Azure Stack cluster?

@patrickdillon
Copy link
Contributor Author

@patrickdillon are you able to build an image with this change and validate on your Azure Stack cluster?

Oh yes, I was able to build and test the fix in an openshift install. This simple change does resolve the panic issue. That said, it's still unclear to me whether we would expect InstanceView to be nil or if there are more implications due to that.

I am fine moving forward, just wondering. I will look into adding unit tests today.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 31, 2025
@patrickdillon
Copy link
Contributor Author

Added unit test in 7974cf4 and also confirmed that the unit test panics on master without the code fix.

/label tide/merge-method-squash

@MartinForReal
Copy link
Contributor

Which apiversion is supported in azure stack?

Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, patrickdillon

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 10, 2025
@andyzhangx
Copy link
Member

the fix is already verified here: kubernetes-sigs/azuredisk-csi-driver#3003, let's merge this fix

@andyzhangx
Copy link
Member

thanks, I will take care of the proceeding fix when the PR is merged in cloud-provider-azure

@patrickdillon
Copy link
Contributor Author

Which apiversion is supported in azure stack?

I was hoping someone here could help clarify that, because I find the topic confusing. According to these docs the profiles released in September and March have the greatest azurestack compatibility.

Looking at the most recent profile, 2020-09-01, that profile is using the V2 SDK at 2020-09-01 (as opposed to calling out to the v1 services packages as other APIs may do):

https://github.com/Azure/azure-sdk-for-go/blob/2187aca40bbf6931ffac666977e5d29128d82585/profiles/2020-09-01/compute/mgmt/compute/computeapi/interfaces.go#L11

So my understanding is that 2020-09-01 is the latest support API version for compute, although we've had better results using 2020-06-01.

Neither would meet the stated API version requirement of 2020-12-01.

@andyzhangx
Copy link
Member

/retest

1 similar comment
@andyzhangx
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit 95731ae into kubernetes-sigs:master Apr 11, 2025
18 checks passed
@k8s-infra-cherrypick-robot

@MartinForReal: new pull request created: #8866

In response to this:

/cherrypick release-1.32

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

@MartinForReal: #8755 failed to apply on top of branch "release-1.31":

Applying: Fix panic for GetZoneByNodeName on Azure Stack
Using index info to reconstruct a base tree...
M	pkg/provider/azure_standard.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/provider/azure_standard.go
CONFLICT (content): Merge conflict in pkg/provider/azure_standard.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Fix panic for GetZoneByNodeName on Azure Stack

In response to this:

/cherrypick release-1.31

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

@MartinForReal: #8755 failed to apply on top of branch "release-1.30":

Applying: Fix panic for GetZoneByNodeName on Azure Stack
Using index info to reconstruct a base tree...
M	pkg/provider/azure_standard.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/provider/azure_standard.go
CONFLICT (content): Merge conflict in pkg/provider/azure_standard.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Fix panic for GetZoneByNodeName on Azure Stack

In response to this:

/cherrypick release-1.30

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

@MartinForReal: #8755 failed to apply on top of branch "release-1.29":

Applying: Fix panic for GetZoneByNodeName on Azure Stack
Using index info to reconstruct a base tree...
M	pkg/provider/azure_standard.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/provider/azure_standard.go
CONFLICT (content): Merge conflict in pkg/provider/azure_standard.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Fix panic for GetZoneByNodeName on Azure Stack

In response to this:

/cherrypick release-1.29

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. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetZoneByNodeName Panics on Azure Stack
8 participants