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

Prevent panic in gardenlet when shoot namespace doesn't have required project label #6408

Merged
merged 2 commits into from
Jul 28, 2022

Conversation

acumino
Copy link
Member

@acumino acumino commented Jul 27, 2022

How to categorize this PR?

/area control-plane
/kind bug

What this PR does / why we need it:
Before #4040 we used ProjectForNamespaceFromReader which returns an error if the project is not found but with #4040 we switched it to ProjectAndNamespaceFromReader which if the project is not found doesn't return an error and the project is set to nil. Which causes panic in gardenlet because it tries to fetch the project name from nil value.

Which issue(s) this PR fixes:
Fixes #6286

Special notes for your reviewer:

Release note:

A bug causing `gardenlet` to panic in case of shoot using namespace which doesn't have the required project label is fixed.

@gardener-prow
Copy link
Contributor

gardener-prow bot commented Jul 27, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@gardener-prow gardener-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/control-plane Control plane related kind/bug Bug cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels Jul 27, 2022
@acumino
Copy link
Member Author

acumino commented Jul 27, 2022

/test all

@gardener-prow gardener-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 27, 2022
pkg/utils/gardener/project.go Outdated Show resolved Hide resolved
pkg/utils/gardener/project.go Outdated Show resolved Hide resolved
@acumino acumino marked this pull request as ready for review July 28, 2022 05:38
@gardener-prow gardener-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 28, 2022
@acumino
Copy link
Member Author

acumino commented Jul 28, 2022

/milestone v1.52

@gardener-prow gardener-prow bot added this to the v1.52 milestone Jul 28, 2022
@acumino
Copy link
Member Author

acumino commented Jul 28, 2022

/invite @ialidzhikov

Copy link
Member

@timebertt timebertt left a comment

Choose a reason for hiding this comment

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

Can you add a release note?

pkg/utils/gardener/project.go Outdated Show resolved Hide resolved
@acumino acumino requested a review from timebertt July 28, 2022 06:24
@gardener-prow gardener-prow bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 28, 2022
@acumino acumino requested a review from ialidzhikov July 28, 2022 07:55
Co-authored-by: Ismail Alidzhikov <i.alidjikov@gmail.com>
@gardener-prow gardener-prow bot 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 Jul 28, 2022
@acumino acumino requested a review from ialidzhikov July 28, 2022 08:36
@ialidzhikov ialidzhikov self-assigned this Jul 28, 2022
Copy link
Member

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

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2022
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Jul 28, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ialidzhikov

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

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2022
@gardener-prow gardener-prow bot merged commit 90ac648 into gardener:master Jul 28, 2022
@acumino acumino deleted the bug/project branch November 21, 2022 04:53
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/control-plane Control plane related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/bug Bug lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gardenlet panics when Shoot is created in a Namespace that does not have the Project labels
4 participants