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

Adds helm schema validation #252

Merged
merged 2 commits into from
Dec 21, 2021
Merged

Adds helm schema validation #252

merged 2 commits into from
Dec 21, 2021

Conversation

philnichol
Copy link
Contributor

Issue #, if available:
Closes aws-controllers-k8s/community#899

Description of changes:
This adds a JSON schema to validate inputs to the helm chart, so that values of an incorrect type, regex or enumeration will fail quickly, rather than after the helm deployment runs.

Please let me know if I've missed any of the enum options.

Also worth noting that regarding the types, this will break functionality for anyone using "true", "false", 1, 0 as a boolean or "42" as an integer, so let me know if you want those added as additional options to those fields.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-bot
Copy link
Collaborator

ack-bot commented Dec 21, 2021

Hi @philnichol. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ack-bot ack-bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 21, 2021
@philnichol
Copy link
Contributor Author

/assign @RedbackThomson

Copy link
Contributor

@RedbackThomson RedbackThomson left a comment

Choose a reason for hiding this comment

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

This work is amazing! Thank you for this great contribution.

Something else to add will be an entry in the code to tell the generator to copy this file alongside the values.yaml in the output - see

"helm/values.yaml.tpl",

templates/helm/values.schema.json Outdated Show resolved Hide resolved
templates/helm/values.schema.json Outdated Show resolved Hide resolved
templates/helm/values.schema.json Show resolved Hide resolved
Signed-off-by: Phil Nichol <35630607+philnichol@users.noreply.github.com>
@philnichol
Copy link
Contributor Author

@RedbackThomson thanks for the speedy review 😃 , have pushed a commit that hopefully addresses your comments

Copy link
Contributor

@RedbackThomson RedbackThomson left a comment

Choose a reason for hiding this comment

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

Sweet. Looks like we are ready to go!

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 21, 2021
@ack-bot
Copy link
Collaborator

ack-bot commented Dec 21, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: philnichol, RedbackThomson

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

@ack-bot ack-bot merged commit 60b04fe into aws-controllers-k8s:main Dec 21, 2021
@philnichol philnichol deleted the helm-schema branch December 21, 2021 23:55
ack-bot pushed a commit that referenced this pull request Dec 27, 2021
Issue #, if available:
Relates #249
Relates #252

Description of changes:
This fixes a bug I introduced in a previous PR (sorry!)
This must default to an empty string rather than null or you get:
```
Error: values don't meet the specifications of the schema(s) in the following chart(s):
s3-chart:
- deployment.priorityClassName: Invalid type. Expected: string, given: null

```

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Helm chart values schema file
3 participants