Skip to content

Conversation

LucaBernstein
Copy link
Member

@LucaBernstein LucaBernstein commented Mar 12, 2025

How to categorize this PR?

/area usability robustness
/kind enhancement

What this PR does / why we need it:
With this PR the limits defined in a CloudProfile can be overridden in a NamespacedCloudProfile to make the defined limits more strict.
Shoot owners must ensure that their currently running shoots and their workers deployed comply to the defined limits.

See also previous PR for CloudProfiles: #11279

Which issue(s) this PR fixes:

Special notes for your reviewer:
/cc @timuthy @timebertt

Release note:

`NamespacedCloudProfile.spec.limits.maxNodesTotal` can be used to override the limit of the maximum number of nodes a shoot can have during runtime, as defined in the parent `CloudProfile`. See [the documentation](https://github.com/gardener/gardener/blob/v1.115.0/docs/usage/shoot/shoot_limits.md) for more details.

@gardener-prow gardener-prow bot requested review from timebertt and timuthy March 12, 2025 05:56
@gardener-prow gardener-prow bot added area/usability Usability related area/robustness Robustness, reliability, resilience related kind/enhancement Enhancement, improvement, extension cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 12, 2025
Copy link
Member

@marc1404 marc1404 left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks for the well-structured PR and tests!
I have a few minor suggestions but nothing that would prevent merging your changes :)

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 12, 2025
Copy link
Contributor

gardener-prow bot commented Mar 12, 2025

LGTM label has been added.

Git tree hash: fb8a930da29c012d8e4e41cf085ff1a53e58709c

@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 12, 2025
@gardener-prow gardener-prow bot requested a review from marc1404 March 12, 2025 10:31
@timuthy
Copy link
Member

timuthy commented Mar 12, 2025

/assign

Copy link
Member

@tobschli tobschli left a comment

Choose a reason for hiding this comment

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

Thank you very much :)

Copy link
Member

@marc1404 marc1404 left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks for addressing my feedback :)

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 13, 2025
Copy link
Contributor

gardener-prow bot commented Mar 13, 2025

LGTM label has been added.

Git tree hash: 75fc4058f506396c1f27db3757c1b074c8c2b072

Copy link
Member

@timuthy timuthy left a comment

Choose a reason for hiding this comment

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

Nice! Thank you for the well structured PR, it was a blast to review it 😃

@@ -585,6 +588,9 @@ func (r *ReferenceManager) Admit(ctx context.Context, a admission.Attributes, _
channel <- fmt.Errorf("unable to delete Machine image version '%s/%s' from CloudProfile %q - version is still in use by shoot '%s/%s' by worker %q", worker.Machine.Image.Name, *worker.Machine.Image.Version, cloudProfile.Name, shoot.Namespace, shoot.Name, worker.Name)
}
}
if hasDecreasedLimits {
validateShootWorkerLimits(channel, shoot, cloudProfile.Spec.Limits)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this validation be executed whenever the limit was changed? This would cover the case that a CloudProfile with a low value was created, and a then increased value is validated appropriately.

In addition, hasDecreasedLimits is a bit contradicting to the core validation where decreasing directly is forbidden (only through add).

Copy link
Member Author

@LucaBernstein LucaBernstein Mar 14, 2025

Choose a reason for hiding this comment

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

I agree that the variable name is misleading. Would you agree to wasLimitAdded?
The validation only needs to be executed if a limit has been introduced, not if it is increased or removed again.

I would suggest the same renaming also for the NamespacedCloudProfile validation.

Copy link
Member Author

Choose a reason for hiding this comment

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

PTAL at 5f06be0.

@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 14, 2025
@gardener-prow gardener-prow bot requested review from marc1404 and timuthy March 14, 2025 14:31
@gardener-prow gardener-prow bot added cla: no Indicates the PR's author has not signed the cla-assistant.io CLA. and removed cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. cla: no Indicates the PR's author has not signed the cla-assistant.io CLA. labels Mar 14, 2025
@gardener-prow gardener-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 17, 2025
@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2025
@gardener-prow gardener-prow bot requested review from marc1404 and timuthy March 17, 2025 11:49
@gardener-prow gardener-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 17, 2025
Copy link
Member

@marc1404 marc1404 left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 18, 2025
Copy link
Contributor

gardener-prow bot commented Mar 18, 2025

LGTM label has been added.

Git tree hash: a79a509099401bb298bc2e2d8db38f53eb591248

Copy link
Contributor

gardener-prow bot commented Mar 18, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marc1404

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

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/robustness Robustness, reliability, resilience related area/usability Usability related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants