datreeio / helm-datree

A Helm plugin to validate charts against the Datree's CLI tool
https://hub.datree.io/integrations
MIT License
113 stars 26 forks source link

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

Closed MoskitoHero closed 2 years ago

MoskitoHero commented 2 years ago

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:



2. See error `sh: ./scripts/install.sh: not found`

![image](https://user-images.githubusercontent.com/346985/146383810-a4ed7005-6d94-4bb2-a091-dd60962087d5.png)

**Expected behavior**
The plugin should install

**Datree plugin version (run `helm datree verion`):**
 - Version: probably the latest at the time of writing.
dimabru commented 2 years ago

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

dimabru commented 2 years ago

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

MoskitoHero commented 2 years ago

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

eyarz commented 2 years ago

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