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

azure: fix null pointer when updating in place cluster #11015

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

collin-woodruff-t1cg
Copy link
Contributor

Null pointer exception occurs when trying to update cluster in place on azure. This occurs because other virtual machine scale sets aside from the master do not have backend loadbalancer pools.

This checks to make sure that the name of the scale set contains "masters" to differentiate between the master and other virtual machine scale sets.

@k8s-ci-robot
Copy link
Contributor

Hi @collin-woodruff-t1cg. Thanks for your PR.

I'm waiting for a kubernetes 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 11, 2021
@k8s-ci-robot k8s-ci-robot added the area/provider/azure Issues or PRs related to azure provider label Mar 11, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 11, 2021
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 11, 2021
@hakman
Copy link
Member

hakman commented Mar 12, 2021

@kenji-cloudnatix maybe you have some thoughts on this.
/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 12, 2021
@kenji-cloudnatix
Copy link
Contributor

Thanks for making the change, @collin-woodruff-t1cg ! Could you explain where the null pointer access is happening?

Is this coming from *i.ID? I'm wondering if we can add direct null-check instead of implicitly relying on the assumption that the VMSS name convention (and also on the assumption that the master is the only one that is backed by a load balancer).

@collin-woodruff-t1cg
Copy link
Contributor Author

yeah the null pointer is happening on line 185 with *ipConfig.LoadBalancerBackendAddressPools. On the other scale sets that field is null so I was getting this exception when trying to update a cluster already in place.

@collin-woodruff-t1cg
Copy link
Contributor Author

although thinking about it now if we don't use a loadbalancer this issue will still be prevelant on the master at that point...

@kenji-cloudnatix
Copy link
Contributor

Ah I see. Thanks! So I believe the right fix is to remove * from line 185?

if ipConfig.LoadBalancerBackendAddressPools != nil {

The type of LoadBalancerBackendAddressPools is *[]SubResource.

@collin-woodruff-t1cg
Copy link
Contributor Author

I gotcha. i just tested that on my end and i no longer receive the null pointer error. Thanks @kenji-cloudnatix!

Copy link
Contributor

@kenji-cloudnatix kenji-cloudnatix left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks!

@k8s-ci-robot
Copy link
Contributor

@kenji-cloudnatix: changing LGTM is restricted to collaborators

In response to this:

Looks good to me! Thanks!

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.

@hakman
Copy link
Member

hakman commented Mar 12, 2021

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kenji-cloudnatix, rifelpet

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2021
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit 6d3c7d4 into kubernetes:master Mar 12, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Mar 12, 2021
k8s-ci-robot added a commit that referenced this pull request Mar 12, 2021
…15-origin-release-1.20

Automated cherry pick of #11015: azure: fix null pointer when updating in place cluster
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. area/provider/azure Issues or PRs related to azure provider 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants