Skip to content

Conversation

jaredallard
Copy link
Contributor

Updates parseHelmChart to support passing capabilities to be passed as chartutil.Capabilities to the helm chart renderer. Right now, only KubeVersion is able to be passed. This is important for rendering helm charts that conditionally render apiVersions, among other fields, based on the current Kubernetes Cluster. The default is 1.20 which doesn't work for all use cases.

I wasn't sure if this is the best approach, nor is this currently an optional field (I will figure that out here soon). I wanted to send this out as proposal PR as well as to get feedback. We need this where I work currently, so I'm very motivated to get this working!

Thank you ✨

@jaredallard
Copy link
Contributor Author

Hmmm, it looks like this can't be made an optional parameter (ref). It seems that native functions aren't able to set that (I may be wrong, so please correct me if my reading of the go-jsonnet source is incorrect.

@mkmik
Copy link
Contributor

mkmik commented Aug 8, 2023

the jsonnet wrapper around the native calls can do default parameters

@mkmik mkmik self-requested a review August 8, 2023 16:07
@jaredallard
Copy link
Contributor Author

the jsonnet wrapper around the native calls can do default parameters

Good call! I'll look into that soon!

Copy link
Contributor

@mkmik mkmik left a comment

Choose a reason for hiding this comment

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

Thanks!

@jaredallard
Copy link
Contributor Author

I'll fix the tests here soon!

@jaredallard
Copy link
Contributor Author

@mkmik I rebased to remove the extra commits (since it looks like y'all do merge commits). The tests should be passing now (they are locally!)

Let me know if there's anything else I should do! Thanks!!

@mkmik
Copy link
Contributor

mkmik commented Sep 5, 2023

sorry, feel free to ping me if I forget about things.

@mkmik mkmik added the automerge Put in the merge queue label Sep 5, 2023
Updates `parseHelmChart` to support passing `capabilities` to be passed
as `chartutil.Capabilities` to the helm chart renderer. Right now, only
`KubeVersion` is able to be passed. This is important for rendering helm
charts that conditionally render `apiVersion`s, among other fields,
based on the current Kubernetes Cluster. The [default is `1.20`](https://github.com/helm/helm/blob/f31d4fb3aacabf6102b3ec9214b3433a3dbf1812/pkg/chartutil/capabilities.go#L31) which
doesn't work for all use cases.
@jaredallard
Copy link
Contributor Author

@mkmik Rebased again to remove the merge commits (it seemed like that might've been the cause of the previous status failure)

@kodiakhq kodiakhq bot merged commit 9d3a6f8 into kubecfg:main Sep 6, 2023
@jaredallard jaredallard deleted the jaredallard/feat/support-setting-capabilities branch September 6, 2023 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Put in the merge queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants