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

policy: Handle failure due to invalid semver range #176

Merged

Conversation

darkowlzz
Copy link
Contributor

This implements the fix in #172 for reconcilers-dev with tests in the new test format.

⚠️ target branch of the PR is reconcilers-dev.

This adds error check after creating a Policer.
For alphabetical and numerical policies, the k8s API validates the
input data. But for semver policy, there aren't predefined valid
values.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
Returning nil wrapped in Policy interface along with error returns an
interface with a nil value. This can't be used to perform a nil check.
To make it safe, return nil value on error.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

This looks all good to me @darkowlzz. Thanks 🙇 🌻

@hiddeco hiddeco requested a review from squaremo October 18, 2021 08:11
@stefanprodan stefanprodan merged commit 72bd994 into fluxcd:reconcilers-dev Oct 26, 2021
@darkowlzz darkowlzz deleted the policy-semver-range-invalid branch November 29, 2021 12:49
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.

4 participants