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

helm upgrade not looking up runfiles correctly #109

Open
ellie-idb opened this issue Oct 28, 2024 · 0 comments
Open

helm upgrade not looking up runfiles correctly #109

ellie-idb opened this issue Oct 28, 2024 · 0 comments

Comments

@ellie-idb
Copy link

Hey there! I'm using rules_helm in a work project, and I noticed that there's an issue when using helm upgrade to automatically push the image. The wrapper script will fail with:

; bazelisk run //helm/hydra:chart.install.preproduction
INFO: Analyzed target //helm/hydra:chart.install.preproduction (1 packages loaded, 15 targets configured).
INFO: Found 1 target...
Target //helm/hydra:chart.install.preproduction up-to-date:
  bazel-bin/helm/hydra/chart.install.preproduction.sh
INFO: Elapsed time: 0.186s, Critical Path: 0.02s
INFO: 2 processes: 2 internal.
INFO: Build completed successfully, 2 total actions
INFO: Running command line: bazel-bin/helm/hydra/chart.install.preproduction.sh
/home/ellie/.cache/bazel/_bazel_ellie/9eacc77f2aa12fa1a5e4c4878a0e0dc6/execroot/_main/bazel-out/k8-fastbuild/bin/helm/hydra/chart.install.preproduction.sh: line 11: push_image.push.sh: command not found

I digged into this a little more, and "push_image.push.sh" doesn't exist in the same directory as the script:

; ls /home/ellie/.cache/bazel/_bazel_ellie/9eacc77f2aa12fa1a5e4c4878a0e0dc6/execroot/_main/bazel-out/k8-fastbuild/bin/helm/hydra
chart                           chart.install.preproduction.sh.repo_mapping  chart.install.preproduction.sh.runfiles_manifest  chart.tgz        chart_yaml.yaml
chart.install.preproduction.sh  chart.install.preproduction.sh.runfiles      chart.metadata.json                               chart_yaml.json  
;

... but it does exist in the working directory of the script, which is set to /home/ellie/.cache/bazel/_bazel_ellie/9eacc77f2aa12fa1a5e4c4878a0e0dc6/execroot/_main/bazel-out/k8-fastbuild/bin/helm/hydra/chart.install.preproduction.sh.runfiles/_main:

; ls /home/ellie/.cache/bazel/_bazel_ellie/9eacc77f2aa12fa1a5e4c4878a0e0dc6/execroot/_main/bazel-out/k8-fastbuild/bin/helm/hydra/chart.install.preproduction.sh.runfiles/_main
_tags.txt  helm  image  image.tar.tar  push_image.push.sh  stable-status.txt  volatile-status.txt

I think the culprit here is this line:

"{EXTRA_CMDS}": "\n".join([pusher.short_path for pusher in image_pushers]),

as changing this line to be:

            "{EXTRA_CMDS}": "\n".join([". {}".format(pusher.short_path) for pusher in image_pushers]),

makes this issue go away. I'm not sure if this is the way that it's meant to be fixed, rather something that I found while trying to fix it.

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

1 participant