-
Notifications
You must be signed in to change notification settings - Fork 115
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 helm template apiVersions flag #894
Add helm template apiVersions flag #894
Conversation
@hausdorff what do you think of this approach to solve the |
One quick note - is it possible to add a test? There are some tests in |
@lukehoban thanks for pointing out the example tests. Working on adding one now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RichardWLaub Thanks for the PR, and sorry for the delayed response! Just a few more suggestions, and then I'll run this through CI and get it merged.
/** | ||
* The optional kubernetes api versions used for Capabilities.APIVersions. | ||
*/ | ||
apiVersions?: pulumi.Input<string[]>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apiVersions?: pulumi.Input<string[]>; | |
apiVersions?: pulumi.Input<pulumi.Input<string>[]>; |
tests/examples/helm-api-versions/helm-api-versions/templates/test-pod.yaml
Show resolved
Hide resolved
new k8s.helm.v2.Chart("api-versions", { | ||
apiVersions: ["foo", "bar"], | ||
path: "helm-api-versions", | ||
transformations: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the suggested update to the Pod manifest, you can update this to
new k8s.helm.v2.Chart("api-versions", {
apiVersions: ["foo", "bar"],
path: "helm-api-versions",
namespace: namespace.metadata.name,
});
import * as k8s from "@pulumi/kubernetes"; | ||
|
||
const namespace = new k8s.core.v1.Namespace("test"); | ||
const namespaceName = namespace.metadata.name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed with suggested update.
const namespaceName = namespace.metadata.name; |
512fdf8
to
ba8ce52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit on the code, but overall LGTM
Could you also update the CHANGELOG? Thanks for the contribution!
? `--api-versions={${cfg.apiVersions | ||
.map(apiVersion => shell.quote([apiVersion])) | ||
.join(',')}}` | ||
: `--api-versions=${cfg.apiVersions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the length would only be 1 here, so how about
`---api-versions=${shell.quote(cfg.apiVersions[0])}`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. shell.quote
takes a string[]
so I just passed in apiVersions
.
Merged these changes in in #951 Thanks for the contribution! |
Proposed changes
Allows me to pass the
--api-versions
flag tohelm template
so I can deploy helm chart resources with the following conditional:Note that example was taken from the prometheus-cloudwatch-exporter helm chart.
Related issues
Fixes #196