Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Fix a nil pointer issue in HC webhook when setting as root #1121

Merged
merged 1 commit into from
Sep 18, 2020

Conversation

yiqigao217
Copy link
Contributor

The bug was found when running e2e tests that the webhook got
INTERNAL_ERROR when setting a namespace as root. Fix it by checking if
the new parent is nil. If yes, early exit since it's impossible to
introduce new naming conflicts.

Add a new unit test case for it. The test failed before and passed after
the change.

Tested by make test and manually.

The bug was found when running e2e tests that the webhook got
INTERNAL_ERROR when setting a namespace as root. Fix it by checking if
the new parent is nil. If yes, early exit since it's impossible to
introduce new naming conflicts.

Add a new unit test case for it. The test failed before and passed after
the change.

Tested by make test and manually.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 18, 2020
@yiqigao217
Copy link
Contributor Author

/assign @adrianludwin
/cc @rjbez17

This is a bug fix. The bug was found when running e2e tests in #1115 . Will cherry-pick this PR into #1115 after it's merged.

Copy link
Contributor

@adrianludwin adrianludwin 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

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 18, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianludwin, yiqigao217

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 Sep 18, 2020
@k8s-ci-robot k8s-ci-robot merged commit a624bfa into kubernetes-retired:master Sep 18, 2020
@adrianludwin adrianludwin added this to the hnc-v0.6 milestone Sep 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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 Indicates that a PR is ready to be merged. 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.

3 participants