stefanprodan / hrval-action

Flux Helm Release validation GitHub action
Apache License 2.0
60 stars 44 forks source link

Issue with helm v3 #27

Closed onedr0p closed 4 years ago

onedr0p commented 4 years ago

Thanks for this cool action! However I'm unable to use it on my public gitops repo. See log below:

https://github.com/onedr0p/k3s-gitops/runs/466223287?check_suite_focus=true

/usr/bin/docker run --name e87b5236ae01e39efc45a68ac7c329c6bc8ba9_760a17 --label e87b52 --workdir /github/workspace --rm -e INPUT_HELMRELEASE -e INPUT_HELMVERSION -e INPUT_KUBERNETESVERSION -e INPUT_IGNOREVALUES -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/k3s-gitops/k3s-gitops":"/github/workspace" e87b52:36ae01e39efc45a68ac7c329c6bc8ba9  "deployments/" "true" "1.17.0" "v3"
Processing deployments/kube-system/metrics-server/metrics-server.yaml
Cloning to /tmp/tmp.M6uOPEXzij
usage: git remote add [<options>] <name> <url>

    -f, --fetch           fetch the remote branches
    --tags                import all tags and associated objects when fetching
                          or do not fetch any tag at all (--no-tags)
    -t, --track <branch>  branch(es) to track
    -m, --master <branch>
                          master branch
    --mirror[=(push|fetch)]
                          set up remote as a mirror to push to or fetch from

fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: You are on a branch yet to be born
Ingnoring Helm release values
Writing Helm release to /tmp/tmp.M6uOPEXzij/metrics-server.release.yaml
Error: validation: chart.metadata is required

Looks like an issue fetching a chart...

Do you have any idea what's going wrong here? I pretty much copied pasted your example.

onedr0p commented 4 years ago

I pulled the script locally and it works fine, I am unsure why github actions is having trouble.

onedr0p commented 4 years ago

Now I am getting a different error running it in the Github Actions:

https://github.com/onedr0p/k3s-gitops/runs/468127476

Run stefanprodan/hrval-action@v3.0.1
/usr/bin/docker run --name e87b52d8ecd0404481439e8b24e2466055d2f3_7d2709 --label e87b52 --workdir /github/workspace --rm -e INPUT_HELMRELEASE -e INPUT_HELMVERSION -e INPUT_KUBERNETESVERSION -e INPUT_IGNOREVALUES -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/k3s-gitops/k3s-gitops":"/github/workspace" e87b52:d8ecd0404481439e8b24e2466055d2f3  "./deployments/" "true" "1.17.2" "v3"
Processing ./deployments/kube-system/metrics-server/metrics-server.yaml
Downloading to /tmp/tmp.yeCal6J8Tb
Error: Couldn't load repositories file (/github/home/.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Error: Couldn't load repositories file (/github/home/.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Ingnoring Helm release values
Writing Helm release to /tmp/tmp.yeCal6J8Tb/metrics-server.release.yaml
Error: path "/tmp/tmp.yeCal6J8Tb/metrics-server" not found
stevenpall commented 4 years ago

@onedr0p This might be fixed by #28.

onedr0p commented 4 years ago

Great! I'll try once it's merged.

onedr0p commented 4 years ago

I am trying v3.1.0 and there still seems to be an issue

name: main

on: [push, pull_request]

jobs:
  hrval:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Validate Helm Releases in deployment directory
        uses: stefanprodan/hrval-action@v3.1.0
        with:
          helmRelease: ./deployments/
          helmVersion: v3
          kubernetesVersion: 1.17.3
          ignoreValues: true

Errors:

/usr/bin/docker run --name e87b5299809c7237fe4ad18eb02f05b9bff1e0_39dd7f --label e87b52 --workdir /github/workspace --rm -e INPUT_HELMRELEASE -e INPUT_HELMVERSION -e INPUT_KUBERNETESVERSION -e INPUT_IGNOREVALUES -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/k3s-gitops/k3s-gitops":"/github/workspace" e87b52:99809c7237fe4ad18eb02f05b9bff1e0  "./deployments/" "true" "1.17.3" "v3"
Ignoring ./deployments/persistent-volumes/data.yaml not a HelmRelease
Ignoring ./deployments/persistent-volumes/media.yaml not a HelmRelease
Ignoring ./deployments/logging/namespace.yaml not a HelmRelease
Processing ./deployments/logging/loki/loki.yaml
Downloading to /tmp/tmp.pJXIpRJKfV
Error: Couldn't load repositories file (/github/home/.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Error: Couldn't load repositories file (/github/home/.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Ingnoring Helm release values
Writing Helm release to /tmp/tmp.pJXIpRJKfV/loki.release.yaml
Error: path "/tmp/tmp.pJXIpRJKfV/loki-stack" not found
onedr0p commented 4 years ago

I can confirm helm v2 works fine.

RichiCoder1 commented 4 years ago

It looks like download doesn't respect the given helm version and always using v2.

RichiCoder1 commented 4 years ago

Is weird its complaining about not being init-d though, since that's part of the dockerfile.

xunholy commented 4 years ago

I can confirm I'm still seeing this error using the latest version

     - name: Validate Helm Releases
        uses: stefanprodan/hrval-action@v3.2.0
        with:
          helmRelease: cluster/
          helmVersion: v3
          kubernetesVersion: 1.18.2
          ignoreValues: false
onedr0p commented 4 years ago

This is still an issue:

Run stefanprodan/hrval-action@v3.2.0
  with:
    helmRelease: deployments/
    helmVersion: v3
    kubernetesVersion: 1.18.8
    ignoreValues: false
    awsS3Repo: false
/usr/bin/docker run --name cbce4c1d5677b1494a86225966d0b7b19b_261c7b --label 8118cb --workdir /github/workspace --rm -e INPUT_HELMRELEASE -e INPUT_HELMVERSION -e INPUT_KUBERNETESVERSION -e INPUT_IGNOREVALUES -e INPUT_AWSS3REPO -e INPUT_AWSS3REPONAME -e INPUT_AWSS3PLUGIN -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/k3s-gitops/k3s-gitops":"/github/workspace" 8118cb:ce4c1d5677b1494a86225966d0b7b19b  "deployments/" "false" "1.18.8" "v3" "false" "" ""
Ignoring deployments/_external_services/rocinante.yaml not a HelmRelease
Ignoring deployments/_external_services/serenity.yaml not a HelmRelease
Ignoring deployments/_external_services/unifi.yaml not a HelmRelease
Ignoring deployments/monitoring/_namespace.yaml not a HelmRelease
Processing deployments/monitoring/blackbox-exporter/blackbox-exporter.yaml
Downloading to /tmp/tmp.V5NgzrGI7l
Error: Couldn't load repositories file (/github/home/.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Error: Couldn't load repositories file (/github/home/.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)
Extracting values to /tmp/tmp.V5NgzrGI7l/prometheus-blackbox-exporter.values.yaml
Writing Helm release to /tmp/tmp.V5NgzrGI7l/prometheus-blackbox-exporter.release.yaml
Error: path "/tmp/tmp.V5NgzrGI7l/prometheus-blackbox-exporter" not found
stefanprodan commented 4 years ago

The fix is in stefanprodan/hrval-action@v3.3.1

onedr0p commented 4 years ago

Ah, yes sorry about that. It seems to be working now 🥳