Skip to content
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

$HOME env is changed for helmfile builder #524

Open
yashbhutwala opened this issue Aug 17, 2021 · 1 comment
Open

$HOME env is changed for helmfile builder #524

yashbhutwala opened this issue Aug 17, 2021 · 1 comment

Comments

@yashbhutwala
Copy link
Contributor

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.

@sadoMasupilami
Copy link

sadoMasupilami commented Sep 14, 2021

hmh, the same just happens to me

solved, probably in a bad way but I did not have a lot of time.

added the following to the beginning of the entrypoint helmfile.bash

mkdir -p $HOME/.local/share/helm
ln -s /root/.local/share/helm/plugins $HOME/.local/share/helm/plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants