Skip to content

Commit

Permalink
Update args to support either helm 2 or 3 (#882)
Browse files Browse the repository at this point in the history
The --name arg is no longer present in helm v3 for helm template, but --name-template appears to accomplish the same thing in both versions. Updated the helm fetch command to use that parameter instead, which should work for both.
  • Loading branch information
lblackstone authored Nov 18, 2019
1 parent 4ea649c commit 3492b0d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ install:
- source ${PULUMI_SCRIPTS}/ci/install-common-toolchain.sh

# Install Helm CLI. Do not install Tiller.
- curl -LO https://storage.googleapis.com/kubernetes-helm/helm-v2.14.3-linux-amd64.tar.gz
- tar -xvf helm-v2.14.3-linux-amd64.tar.gz
- curl -LO https://get.helm.sh/helm-v3.0.0-linux-amd64.tar.gz
- tar -xvf helm-v3.0.0-linux-amd64.tar.gz
- sudo mv linux-amd64/helm /usr/local/bin
- helm init --client-only
- helm repo add stable https://kubernetes-charts.storage.googleapis.com/
- helm repo update

# Install Pulumi
- curl -L https://get.pulumi.com/ | bash
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
- v1.15.x
- v1.14.x

### Improvements

- Add support for helm 3 CLI tool. (https://github.com/pulumi/pulumi-kubernetes/pull/882).

## 1.3.0 (November 13, 2019)

### Supported Kubernetes versions
Expand Down
2 changes: 1 addition & 1 deletion pkg/gen/nodejs-templates/helm/v2/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class Chart extends yaml.CollectionComponentResource {
? `--namespace ${shell.quote([cfg.namespace])}`
: "";
const yamlStream = execSync(
`helm template ${chart} --name ${release} --values ${defaultValues} --values ${values} ${namespaceArg}`,
`helm template ${chart} --name-template ${release} --values ${defaultValues} --values ${values} ${namespaceArg}`,
{
maxBuffer: 512 * 1024 * 1024 // 512 MB
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/gen/python-templates/helm/v2/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def _parse_chart(all_config: Tuple[str, Union[ChartOpts, LocalChartOpts], pulumi
namespace_arg = ['--namespace', config.namespace] if config.namespace else []

# Use 'helm template' to create a combined YAML manifest.
cmd = ['helm', 'template', chart, '--name', release_name,
cmd = ['helm', 'template', chart, '--name-template', release_name,
'--values', default_values, '--values', overrides_filename]
cmd.extend(namespace_arg)

Expand Down
2 changes: 1 addition & 1 deletion sdk/nodejs/helm/v2/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class Chart extends yaml.CollectionComponentResource {
? `--namespace ${shell.quote([cfg.namespace])}`
: "";
const yamlStream = execSync(
`helm template ${chart} --name ${release} --values ${defaultValues} --values ${values} ${namespaceArg}`,
`helm template ${chart} --name-template ${release} --values ${defaultValues} --values ${values} ${namespaceArg}`,
{
maxBuffer: 512 * 1024 * 1024 // 512 MB
},
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/pulumi_kubernetes/helm/v2/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def _parse_chart(all_config: Tuple[str, Union[ChartOpts, LocalChartOpts], pulumi
namespace_arg = ['--namespace', config.namespace] if config.namespace else []

# Use 'helm template' to create a combined YAML manifest.
cmd = ['helm', 'template', chart, '--name', release_name,
cmd = ['helm', 'template', chart, '--name-template', release_name,
'--values', default_values, '--values', overrides_filename]
cmd.extend(namespace_arg)

Expand Down

0 comments on commit 3492b0d

Please sign in to comment.