-
Notifications
You must be signed in to change notification settings - Fork 183
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: Fix budget validation through CEL #1006
fix: Fix budget validation through CEL #1006
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jonathan-innis 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 |
Pull Request Test Coverage Report for Build 7880242002Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
@@ -109,7 +109,7 @@ spec: | |||
type: array | |||
x-kubernetes-validations: | |||
- message: '''schedule'' must be set with ''duration''' | |||
rule: '!self.all(x, (has(x.schedule) && !has(x.duration)) || (!has(x.schedule) && has(x.duration)))' | |||
rule: self.all(x, has(x.schedule) == has(x.duration)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be an &&
and not ==
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
means they match. That's all that we require. Either they are both set or they are both not set.
/lgtm |
Fixes #1003
Description
Budget validation for CEL wasn't properly catching the case where one budget had properly set the schedule and duration together but another hadn't. This change ensures that every budget has set a valid combination of schedule and duration
How was this change tested?
make presubmit
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.