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: avoid nil-pointer panic when checking the frontend IP configuration #101739

Merged
merged 1 commit into from
May 10, 2021

Conversation

nilo19
Copy link
Member

@nilo19 nilo19 commented May 5, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

fix: avoid nil-pointer panic when checking the frontend IP configuration

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

fix: avoid nil-pointer panic when checking the frontend IP configuration

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


@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. 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. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 5, 2021
@nilo19
Copy link
Member Author

nilo19 commented May 5, 2021

/area provider/azure
/triage accepted
/priority critical-urgent
/sig cloud-provider
cc @feiskyer

@k8s-ci-robot k8s-ci-robot added area/provider/azure Issues or PRs related to azure provider triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 5, 2021
@k8s-ci-robot k8s-ci-robot requested review from aramase and feiskyer May 5, 2021 09:41
@nilo19
Copy link
Member Author

nilo19 commented May 5, 2021

/retest

@nilo19 nilo19 force-pushed the bug/nil-pointer branch from fbb09b7 to 32674fd Compare May 5, 2021 12:40
@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 May 5, 2021
@nilo19 nilo19 force-pushed the bug/nil-pointer branch from 32674fd to 527a9c9 Compare May 5, 2021 12:46
@nilo19
Copy link
Member Author

nilo19 commented May 5, 2021

/retest

Copy link
Member

@feiskyer feiskyer 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 May 6, 2021
@nilo19
Copy link
Member Author

nilo19 commented May 7, 2021

@cheftako could you help to approve?

pip.PublicIPAddressPropertiesFormat != nil &&
pip.IPAddress != nil &&
fip.FrontendIPConfigurationPropertiesFormat != nil &&
fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Did you want to also verify fip.PublicIPAddress != nil ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, but fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress is more clear for reading

Choose a reason for hiding this comment

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

The funny thing is that I also was confused why fip.PublicIPAddress was not checked - is that not the real problem in the code on the next line? Either that code should also used the "more clear" syntax or some comment should be here about how both end up being the same pointer since that is very much not clear from reading this code in this file.

@cheftako
Copy link
Member

cheftako commented May 7, 2021

/lgtm
Happy to approve, wanted to give you a chance to answer about the extra check.

@cheftako
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheftako, feiskyer, nilo19

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 10, 2021
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit e6f6f4b into kubernetes:master May 10, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone May 10, 2021
@nilo19 nilo19 deleted the bug/nil-pointer branch May 11, 2021 01:07
k8s-ci-robot added a commit that referenced this pull request Jun 8, 2021
…39-upstream-release-1.21

Cherry pick of #101739: fix: avoid nil-pointer panic when checking the frontend IP configuration
k8s-ci-robot added a commit that referenced this pull request Jun 9, 2021
…39-upstream-release-1.20

Cherry pick of #101739: fix: avoid nil-pointer panic when checking the frontend IP configuration
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/cloudprovider area/provider/azure Issues or PRs related to azure provider 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. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants