datreeio/helm-datree

Can't install plugin in Gitlab CI with alpine/helm image

MoskitoHero opened this issue · 4 comments

Describe the bug
When trying to install the plugin in Gitlab CI with the alpine/helm, I get a failure.

To Reproduce
Steps to reproduce the behavior:

  1. Run this script in Gitlab CI (truncated for privacy reasons)
stages:
  - test

test:
  stage: test
  image:
    name: alpine/helm:3.7.2
    entrypoint: [""]
  variables:
    DATREE_TOKEN: XXXXXXXXXXXXXXXXXXXXX
    HELM_PLUGINS: ./.helm_plugins
  before_script:
    # Debugging pluging
    - helm plugin list # Should be empty
    # Install another plugin just to check
    - helm plugin install https://github.com/technosophos/helm-github
    - helm plugin list # Should list the helm-github plugin
    - helm plugin install https://github.com/datreeio/helm-datree
    - helm plugin list # Should list both pluging
  script:
    - ...
  1. See error sh: ./scripts/install.sh: not found

image

Expected behavior
The plugin should install

Datree plugin version (run helm datree verion):

  • Version: probably the latest at the time of writing.

Hi @MoskitoHero,
Thanks a lot for bringing this to our attention. I was able to reproduce this and am looking into it.

I was able to create a workaround with an ubuntu image

FROM ubuntu
RUN apt update
RUN apt install -y unzip curl git
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
RUN chmod 700 get_helm.sh
RUN ./get_helm.sh
RUN helm plugin install https://github.com/datreeio/helm-datree
RUN helm plugin list
RUN helm datree version

We are working on a solution for this bug

Looks like there are a couple of missing dependencies in alpine/helm.
Adding the following command to the ci should fix this: apk add curl bash
This will add curl and bash commands which our install scripts requires in order to run.

@MoskitoHero Please let me know if that fixes your issue

It does, thank you. I thought bash was installed in that image. I guess this can be closed now.

eyarz commented

@MoskitoHero thank you for verifying this solution.
I have also added it to our docs.