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 nil pointers in conditions patch utils #6401

Merged

Conversation

killianmuldoon
Copy link
Contributor

Signed-off-by: killianmuldoon [email protected]

Adds nil checks to methods in the conditions patch utils to ensure they don't panic when passed a nil or an interface that evaluates to nil.

Fixes #6400

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 8, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 8, 2022
@killianmuldoon killianmuldoon force-pushed the fix/nil-condition-patch branch from 0198608 to 87c6c03 Compare April 11, 2022 11:19
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 11, 2022
@killianmuldoon killianmuldoon force-pushed the fix/nil-condition-patch branch 2 times, most recently from 073fbb1 to 3f64b83 Compare April 11, 2022 11:24
Copy link
Member

@chrischdi chrischdi 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 14, 2022
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

util/conditions/patch_test.go Outdated Show resolved Hide resolved
util/conditions/patch_test.go Outdated Show resolved Hide resolved
util/conditions/patch_test.go Outdated Show resolved Hide resolved
util/conditions/patch_test.go Outdated Show resolved Hide resolved
util/conditions/patch.go Outdated Show resolved Hide resolved
util/conditions/getter_test.go Show resolved Hide resolved
util/conditions/patch.go Outdated Show resolved Hide resolved
util/conditions/patch.go Outdated Show resolved Hide resolved
util/conditions/patch.go Outdated Show resolved Hide resolved
util/conditions/patch_test.go Show resolved Hide resolved
util/conditions/patch_test.go Outdated Show resolved Hide resolved
@vincepri
Copy link
Member

vincepri commented Jun 9, 2022

Any updates on this PR?

@vincepri
Copy link
Member

@killianmuldoon do you have time to address the comments above?

@killianmuldoon killianmuldoon force-pushed the fix/nil-condition-patch branch from 3f64b83 to 4bc50ff Compare July 1, 2022 15:28
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 1, 2022
@killianmuldoon killianmuldoon force-pushed the fix/nil-condition-patch branch from 4bc50ff to e18d6e2 Compare July 1, 2022 16:12
Copy link
Contributor

@ykakarap ykakarap 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 Jul 2, 2022
Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

A few nits otherwise lgtm

util/conditions/patch.go Outdated Show resolved Hide resolved
util/conditions/patch_test.go Outdated Show resolved Hide resolved
@killianmuldoon killianmuldoon force-pushed the fix/nil-condition-patch branch from e18d6e2 to 5cc4e69 Compare July 4, 2022 12:11
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 4, 2022
@killianmuldoon killianmuldoon force-pushed the fix/nil-condition-patch branch 2 times, most recently from fa456ca to 86bfa7f Compare July 4, 2022 12:29
util/util.go Outdated Show resolved Hide resolved
@killianmuldoon killianmuldoon force-pushed the fix/nil-condition-patch branch from 86bfa7f to 6b79924 Compare July 4, 2022 13:31
@k8s-ci-robot
Copy link
Contributor

@killianmuldoon: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-apidiff-main 6b79924 link false /test pull-cluster-api-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@sbueringer
Copy link
Member

/lgtm

/assign @vincepri

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 4, 2022
@sbueringer
Copy link
Member

/cherry-pick release-1.2

(in case we don't get it into the v1.2 release (which is fine) we have to move the migration comment)

@k8s-infra-cherrypick-robot

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

In response to this:

/cherry-pick release-1.2

(in case we don't get it into the v1.2 release (which is fine) we have to move the migration comment)

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.

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

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 4, 2022
@k8s-ci-robot k8s-ci-robot merged commit 7741204 into kubernetes-sigs:main Jul 4, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.3 milestone Jul 4, 2022
@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #6813

In response to this:

/cherry-pick release-1.2

(in case we don't get it into the v1.2 release (which is fine) we have to move the migration comment)

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.

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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Util Conditions patcher returns nil pointer error
8 participants