[8.x](backport #5535) [Helm] Implement values.schema.json #5581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR does the following:
value.schema.json
inside the chart which is used by Helm to validate the input values.yamlhostNetwork
as an option in an Agent presetWhy is it important?
By having a
value.schema.json
we can reduce validation checks inside the templates of the Helm chart (less ifs inside templates). Furthermore, many text editors/IDEs offer the capability to import the schema and hence get hints and proposal write writing avalues.yaml
for the Helm chartChecklist
I have made corresponding changes to the documentationI have added tests that prove my fix is effective or that my feature worksI have added an entry in./changelog/fragments
using the changelog toolI have added an integration test or an E2E testDisruptive User Impact
N/A
How to test this PR locally
Checking validation
run the following which is actually missing required values
helm template test ./deploy/helm/elastic-agent --set kubernetes.enabled=true --set outputs.default.type=ESSecretAuthBasic --set agent.fleet.enabled=true --set agent.fleet.token=""
you should see the following errors
Checking hints
# yaml-language-server: $schema=elastic-agent/deploy/helm/elastic-agent/values.schema.json
Related issues
N/A
This is an automatic backport of pull request #5535 done by [Mergify](https://mergify.com).