Skip to content

[kube-prometheus-stack] allow extraManifests as map/list #5475

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

Merged

Conversation

TheRealNoob
Copy link
Contributor

What this PR does / why we need it

Allow extraManifests to be of type map or list. Useful for splitting the values across multiple files, such as one encrypted and another not.

Which issue this PR fixes

None

Special notes for your reviewer

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

Copy link
Member

@jkroepke jkroepke left a comment

Choose a reason for hiding this comment

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

Could you please add a extraManifests example here (list) that contains object and string elements?

https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/ci/03-non-defaults-values.yaml

and here a example with strings and objects, but extraManifests is an object:

https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/ci/05-ingress-and-gateway-routes-values.yaml

That should cover all possibilities through CI.

@TheRealNoob
Copy link
Contributor Author

Will do. In the sake of testing I will share the helm-unittests that I wrote for one of our internal charts. All of these tests pass. Hopefully that gives you some confidence. The only difference is this chart doesn't call it extraManifests but manifests.

https://gist.github.com/TheRealNoob/ca7dee0e862a4e5526a115d54e863ec9

TheRealNoob and others added 5 commits March 25, 2025 13:49
Signed-off-by: TheRealNoob <[email protected]>
Signed-off-by: TheRealNoob <[email protected]>
Signed-off-by: TheRealNoob <[email protected]>
@TheRealNoob TheRealNoob force-pushed the kps_refactor_extraobjects branch from 92773ed to 6784985 Compare March 25, 2025 20:50
@GMartinez-Sisti
Copy link
Member

Will do. In the sake of testing I will share the helm-unittests that I wrote for one of our internal charts. All of these tests pass. Hopefully that gives you some confidence. The only difference is this chart doesn't call it extraManifests but manifests.

https://gist.github.com/TheRealNoob/ca7dee0e862a4e5526a115d54e863ec9

We have some tests on https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/unittests, if you have them already you can add them.

Copy link
Member

@jkroepke jkroepke left a comment

Choose a reason for hiding this comment

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

LGTM. But Gitleaks has some issues.

Optionally, add the unit tests, if you wish. @GMartinez-Sisti not sure, if they part of CI

@GMartinez-Sisti
Copy link
Member

LGTM. But Gitleaks has some issues.

Optionally, add the unit tests, if you wish. @GMartinez-Sisti not sure, if they part of CI

They are disabled 😢 : https://github.com/prometheus-community/helm-charts/blob/main/.github/linters/ct.yaml#L4

Will send a PR to enable as I think there is great value on this.

@TheRealNoob
Copy link
Contributor Author

I removed the linting tests and added the unittest since it's more comprehensive. This should also fix the gitleaks error.

@GMartinez-Sisti unfortunately not all of the tests pass right now, but I at least made sure that extraObjects does. Here is the output so you can have a look. Also I changed the command slightly because it ran my test twice - find it at the top of the gist. The reason I placed the test at unittests/extra-objects_test.yaml is because I figure we're supposed to follow the format of the templates/ dir, which I did. It just happens to be the singular exception to the structure.

@TheRealNoob
Copy link
Contributor Author

@jkroepke ready for merge?

Copy link
Member

@jkroepke jkroepke left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks

@jkroepke jkroepke merged commit 21bbefe into prometheus-community:main Apr 15, 2025
5 checks passed
@TheRealNoob TheRealNoob deleted the kps_refactor_extraobjects branch April 15, 2025 22:47
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.

3 participants