GoogleContainerTools / GoogleContainerTools/skaffold

Helm chartPath template doesn't render for `deploy` command

Open
#8,938 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior

The value in the `.deploy.helm.releases.0.chartPath` always passes through template rendering

### Actual behavior

When running locally `skaffold deploy` correctly renders the value out of my local environment into the `helm` install command. When the same command and same version of skaffold run in our CD pipeline (Azure Devops Pipeline), the template text itself is passed to helm.

### Information

- Skaffold version: v2.6.0
- Operating system: Local - WSL 2 Ubuntu 22.04 / CD pipeline - Ubuntu 22.04 based image
- Installed via: Downloaded amd64 binary
- Contents of skaffold.yaml:

```yaml
apiVersion: skaffold/v2beta19
kind: Config
deploy:
helm:
releases:
- name: calendar
chartPath: '{{.HELM_REPO}}/service'
namespace: calendar
profiles:
- name: dev
patches:
- op: replace
path: /deploy/helm/releases/0/namespace
value: dev-calendar
```

### Steps to reproduce the behavior
1. `skaffold -v=debug deploy -t -p dev -f skaffold-aws.yaml --kubeconfig ...`

Logs have been redacted to pull most of the environment out, but all the expected image information is there.

Running locally:

```
DEBU[0000] Executing template &{envTemplate 0xc0008aa900 0xc0009a2af0 } with environment map[HELM_REPO:/work/test/blah HOME:/root HOSTNAME:26ffc094d641 ...] subtask=-1 task=DevLoop
DEBU[0000] Running command: [helm --kube-context template calendar /work/test/blah/service --post-renderer /usr/local/bin/skaffold --set dbimage.repository=.dkr.ecr.us-east-2.amazonaws.com/calendar-db --set dbimage.tag=1779... --set image.repository=.dkr.ecr.us-east-2.amazonaws.com/calendar --set image.tag=1779... -f deploy/aws-dev/values.yaml --namespace dev-calendar] subtask=0 task=Render
```

CICD logs

```
time="2023-07-07T13:14:45Z" level=debug msg="Executing template &{envTemplate 0xc00126a120 0xc001232a50 } with environment map[... HELM_REPO:/work/1/s/platform/deploy HOME:/root HOSTNAME:aws-deploy-ado-agent-0 ...]" subtask=-1 task=DevLoop
time="2023-07-07T13:14:45Z" level=debug msg="Running command: [helm --kube-context arn:aws:eks:us-east-2: install calendar {{.HELM_REPO}}/service --post-renderer /usr/local/bin/skaffold --namespace dev-calendar --set dbimage.repository=.dkr.ecr.us-east-2.amazonaws.com/calendar-db --set dbimage.tag=1779... --set image.repository=.dkr.ecr.us-east-2.amazonaws.com/calendar --set image.tag=1779... -f deploy/aws-dev/values.yaml --kubeconfig /work/_temp/kubeconfig]" subtask=0 task=Deploy
Error: INSTALLATION FAILED: repo {{.HELM_REPO}} not found
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.