GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders-community

$HOME env is changed for helmfile builder

Open
#524 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
1.3k
Forks
848
PR merge metrics
No merged PRs in 30d

Description

## Affected builder image

(e.g., `gcr.io/cloud-builders-community/helm`)
`gcr.io/cloud-builders-community/helmfile`

## Expected Behavior

helm diff plugin is installed and works out of the box.

## Actual Behavior

```
err 2: command "/builder/helmfile/helm" exited with non-zero status:

PATH:
/builder/helmfile/helm

ARGS:
0: helm (4 bytes)
1: diff (4 bytes)
2: upgrade (7 bytes)
3: --reset-values (14 bytes)
4: --allow-unreleased (18 bytes)
5: webapp (6 bytes)
6: rimusz/gcloud-sqlproxy (22 bytes)
7: --version (9 bytes)
8: ~0.20.6 (7 bytes)
9: --namespace (11 bytes)
10: default (7 bytes)
11: --values (8 bytes)
12: /tmp/helmfile633672291/default-webapp-values-5764c7f8cd (55 bytes)
13: --set (5 bytes)
14: cloudsql.instances[0].instance=webapp (37 bytes)

ERROR:
exit status 1

EXIT STATUS
1

STDERR:
Error: unknown command "diff" for "helm"
Run 'helm --help' for usage.

COMBINED OUTPUT:
Error: unknown command "diff" for "helm"
Run 'helm --help' for usage.
```

## Steps to Reproduce the Problem

1. `gcloud builds submit --config cloudbuild.yaml .`

2. yaml
```
- name: "gcr.io/$PROJECT_ID/helmfile"
# entrypoint: "bash"
# args:
# - '-eEuox'
# - 'pipefail'
# - '-c'
# - |-
# whoami
# env
# helm plugin list
# helm env
# # helm plugin install https://github.com/databus23/helm-diff
# # helm plugin list
args:
[
"--file",
"gcloud/development/helmfile.yaml",
"diff",
"--context",
"1",
]
```

Not sure if there is something weird with the image or whether a bug with GCP CloudBuild, since it changes the home from `/root` to `/builders/home` and as a result helm cannot see that the plugin is downloaded.

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.