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

Add basic resource correctness tests for the elastic-agent Helm Chart #6014

Open
swiatekm opened this issue Nov 13, 2024 · 1 comment
Open
Labels
Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@swiatekm
Copy link
Contributor

Helm lets us generate whatever we want, as long as it's valid yaml. In order to check whether our manifests contain valid Kubernetes resources, we'd need to actually apply them to a running API Server, which is annoying to do if we want to run this kind of test for a lot of different values files.

However, we can instead simply load the manifests into the right struct in a standard Go test. This can be made fully dynamic as long as we register all the necessary schemas, and with packages like terratest, even rendering the manifests can be done within the Go test. Here's a working example of this idea: https://github.com/SumoLogic/sumologic-kubernetes-collection/blob/30d3c3ffb1d5d8bd87e76cf4285777c20a1bfdb4/tests/helm/common_test.go#L24.

@swiatekm swiatekm added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Nov 13, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

2 participants