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: check limits mutation. #53

Merged
merged 1 commit into from
Aug 12, 2024
Merged

Conversation

jvanz
Copy link
Member

@jvanz jvanz commented Aug 9, 2024

Description

The policy adds resource limits when they are missing in the containers. However, depending the requested resources and the policy configuration the users can hit a scenario where the policy mutates the resource adding a limit which is less than the requested resource. Therefore, Kubernetes will complain about it. To avoid this issue, the policy checks if the result of the mutation is valid. If it's not, reject the request to force the user to change the minimum request resource amount or adjust the policy configuration.

Fix #52

@jvanz jvanz self-assigned this Aug 9, 2024
@jvanz jvanz requested a review from a team as a code owner August 9, 2024 19:01
Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

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

LGTM!

@jvanz jvanz force-pushed the check-limit-mutation branch from c36574d to daac0dd Compare August 12, 2024 17:37
The policy adds resource limits when they are missing in the containers.
However, depending the requested resources and the policy configuration
the users can hit a scenario where the policy mutates the resource
adding a limit which is less than the requested resource. Therefore,
Kubernetes will complain about it. To avoid this issue, the policy
checks if the result of the mutation is valid. If it's not, reject the
request to force the user to change the minimum request resource
amount or adjust the policy configuration.

Signed-off-by: José Guilherme Vanz <[email protected]>
@jvanz jvanz force-pushed the check-limit-mutation branch from daac0dd to 6078d30 Compare August 12, 2024 17:43
@jvanz jvanz merged commit fbf8f1a into kubewarden:main Aug 12, 2024
4 checks passed
@jvanz jvanz deleted the check-limit-mutation branch August 12, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve handling of containers without limit
2 participants