Giter Club home page Giter Club logo

chart-testing-action's Introduction

chart-testing Action

A GitHub Action for installing the helm/chart-testing CLI tool.

Usage

Pre-requisites

  1. A GitHub repo containing a directory with your Helm charts (e.g: charts)
  2. A workflow YAML file in your .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file

Inputs

For more information on inputs, see the API Documentation

  • version: The chart-testing version to install (default: 3.11.0)
  • yamllint_version: The yamllint version to install (default: 1.33.0)
  • yamale_version: The yamale version to install (default: 4.0.4)

Example Workflow

Create a workflow (eg: .github/workflows/lint-test.yaml):

Note that Helm and Python must be installed. This can be achieved using actions as shown in the example below. Python is required because ct lint runs Yamale and yamllint which require Python.

name: Lint and Test Charts

on: pull_request

jobs:
  lint-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Set up Helm
        uses: azure/[email protected]
        with:
          version: v3.14.4

      - uses: actions/setup-python@v5
        with:
          python-version: '3.x'
          check-latest: true

      - name: Set up chart-testing
        uses: helm/[email protected]

      - name: Run chart-testing (list-changed)
        id: list-changed
        run: |
          changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
          if [[ -n "$changed" ]]; then
            echo "changed=true" >> "$GITHUB_OUTPUT"
          fi

      - name: Run chart-testing (lint)
        if: steps.list-changed.outputs.changed == 'true'
        run: ct lint --target-branch ${{ github.event.repository.default_branch }}

      - name: Create kind cluster
        if: steps.list-changed.outputs.changed == 'true'
        uses: helm/[email protected]

      - name: Run chart-testing (install)
        if: steps.list-changed.outputs.changed == 'true'
        run: ct install --target-branch ${{ github.event.repository.default_branch }}

This uses helm/kind-action GitHub Action to spin up a kind Kubernetes cluster, and helm/chart-testing to lint and test your charts on every pull request.

Upgrading from v1.x.x

v2.0.0 is a major release with breaking changes. The action no longer wraps the chart-testing tool but simply installs it. It is no longer run in a Docker container. All ct options are now directly available without the additional abstraction layer.

Code of conduct

Participation in the Helm community is governed by the Code of Conduct.

chart-testing-action's People

Contributors

cpanato avatar crowdsalat avatar davidkarlsen avatar dependabot[bot] avatar derektbrown avatar dunglas avatar evrardjp avatar froblesmartin avatar fty4 avatar hairmare avatar joehorsnell avatar lemeurherve avatar ludea avatar monotek avatar naseemkullah avatar paulczar avatar scottrigby avatar steven-sheehy avatar torstenwalter avatar unguiculus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chart-testing-action's Issues

Allow running with out a detected change

Currently it is not possible run without a change being detected:

if [[ -z "$changed" ]]; then
echo 'No chart changes detected.'
return
fi

I think it would make sense allowing to also run in a case where there is no "change detection" possible. e.g. you run CI job A, which creates a new helm package, and passes it over to job B which should validate it.

getting error while pulling the image from private ECR repository

>>> helm install charts/noon-backend --name noon-backend-mx5w1vvaju --namespace noon-backend-mx5w1vvaju --wait --timeout 600
Error: release noon-backend-mx5w1vvaju failed: timed out waiting for the condition
======================================================================================
........................................................................................................................
==> Events of namespace noon-backend-mx5w1vvaju
........................................................................................................................

...

8m10s       Warning   Failed                         pod/prod-users-srv-8b68fc77d-ktkdn       spec.containers{prod-users-srv}   kubelet, chart-testing-control-plane   Failed to pull image "***.dkr.ecr.eu-central-1.amazonaws.com/prod-users-repository:latest": rpc error: code = Unknown desc = failed to pull and unpack image "***.dkr.ecr.eu-central-1.amazonaws.com/prod-users-repository:latest": failed to resolve reference "***.dkr.ecr.eu-central-1.amazonaws.com/prod-users-repository:latest": unexpected status code [manifests latest]: 401 Unauthorized   9m44s        4       prod-users-srv-8b68fc77d-ktkdn.163b54d61c26c5b5
8m10s       Warning   Failed                         pod/prod-users-srv-8b68fc77d-ktkdn       spec.containers{prod-users-srv}   kubelet, chart-testing-control-plane   Error: ErrImagePull                                                                                                                                                                                                                                                                                                                                                                                                             9m44s        4       prod-users-srv-8b68fc77d-ktkdn.163b54d61c270c05
4m40s       Normal    BackOff                        pod/prod-users-srv-8b68fc77d-ktkdn       spec.containers{prod-users-srv}   kubelet, chart-testing-control-plane   Back-off pulling image "***.dkr.ecr.eu-central-1.amazonaws.com/prod-users-repository:latest"                                                                                                                                                                                                                                                                                                                           9m44s        20      prod-users-srv-8b68fc77d-ktkdn.163b54d61d37a9cb
7m44s       Warning   Failed                         pod/prod-users-srv-8b68fc77d-ktkdn       spec.containers{prod-users-srv}   kubelet, chart-testing-control-plane   Error: ImagePullBackOff  

what's the workaround? I have tried to get login to ECR as the step before chart install step but it seems to be not working.

[Feature Request] ct.yaml override per chart

Currently, if you have a ct.yaml you must define it in a single place and pass it to the action. If any chart has a unique requirement this becomes problematic. Examples would be if a chart is a library, or if a chart had required defaults that are not set in the values.yaml file.

Action is incompatible with `actions/checkout@v2`

We are using the action to validate helm charts, see https://github.com/eclipse/packages/blob/master/.github/workflows/ci.yaml

However, without having knowingly changed anything, linting fails with no indication at all:

https://github.com/eclipse/packages/pull/73/checks?check_run_id=495784296

Digest: sha256:7b99d26b07eb41c19186ef5f7ac334b93736b767d971fb46976c36908440ef82
Status: Downloaded newer image for quay.io/helmpack/chart-testing:v2.4.0
e489b009fa2bfef8965b2e38b58b153ec45b6507ad3b5071de052103886c0c96

Removing ct container...
Done!

image

As this is not the only PR which suffers from this, I don't think it is related to the PR. Also running helm lint locally works just fine.

Affected PRs:

apiVersion issue in lint

I'm having this configuration:

name: Lint and Test Charts

on: pull_request

jobs:
  lint-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Fetch history
        run: git fetch --prune --unshallow

      - name: Run chart-testing (lint)
        id: lint
        uses: helm/[email protected]
        with:
          command: lint
          config: ct.yaml

      - name: Create kind cluster
        uses: helm/[email protected]
        with:
          installLocalPathProvisioner: true
        # Only build a kind cluster if there are chart changes to test.
        if: steps.lint.outputs.changed == 'true'

      - name: Run chart-testing (install)
        uses: helm/[email protected]
        with:
          command: install

and I'm using apiVersion as v2 in my chart.
and while using this workflow, it gives me an error and says apiVersion v2 is not valid.
here is the error: https://github.com/saikatharryc/helm/runs/597069311
and while I do helm lint by changing it to v2, it says this:

➜  helm_chart git:(ci_setup) helm lint ./charts/judge0 
==> Linting ./charts/judge0
[ERROR] Chart.yaml: dependencies are not valid in the Chart file with apiVersion 'v1'. They are valid in apiVersion 'v2'

Error: 1 chart(s) linted, 1 chart(s) failed

chart-testing-action v2 failing to install pyyaml

We're getting some python errors in our logs. Here's the excerpt:

Building wheels for collected packages: pyyaml
  Running setup.py bdist_wheel for pyyaml: started
  Running setup.py bdist_wheel for pyyaml: finished with status 'error'
  Complete output from command /opt/hostedtoolcache/ct/v3.3.0/x86_64/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0n2ie3qi/pyyaml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp9srf5saopip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Running setup.py clean for pyyaml
  Failed building wheel for pyyaml
Failed to build pyyaml

You can see the full log here.

Looks like we're missing wheel?

list-changed command fails without error

I try to set up a basic helm chart repo but I'm stuck with this issue :

image

I also tried running ct list-changed directly but it does not show anything.

my workflow:

name: Lint and Test Charts

on:
  pull_request:
    paths-ignore:
      - 'README.md'
      - 'charts/**/README.md'
      - 'LICENSE'

jobs:
  lint-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0        

      - name: Install Helm
        uses: azure/setup-helm@v1
        with:
          version: v3.4.0

      - name: Set up chart-testing
        uses: helm/[email protected]

      - name: Run chart-testing (list-changed) # <- stuck here
        id: list-changed
        run: |
          changed=$(ct list-changed)
          if [[ -n "$changed" ]]; then
            echo "::set-output name=changed::true"
          fi

      - name: Run chart-testing (lint)
        id: lint
        if: steps.list-changed.outputs.changed == 'true'
        run: ct lint --config ct.yaml

      - name: Create kind cluster
        uses: helm/[email protected]
        with:
          install_local_path_provisioner: true
        if: steps.list-changed.outputs.changed == 'true'

      - name: Run chart-testing (install)
        id: install
        if: steps.list-changed.outputs.changed == 'true'
        run: ct install --config ct.yaml

ct.yaml

helm-extra-args: --timeout 600s
chart-dirs:
  - charts
target-branch: main

file structure :

$ tree
.
├── charts
│   └── driftctl
│       ├── Chart.yaml
│       ├── templates
│       │   ├── _helpers.tpl
│       │   ├── job.yaml
│       │   ├── NOTES.txt
│       │   └── volume-cm.yaml
│       └── values.yaml
├── ct.yaml
├── LICENSE
└── README.md

3 directories, 9 files

Using --set at install time for a given chart ?

Is this possible to specify values when installing a given chart with ct (using --set or --values) ?

I have a chart that needs to --set customResourceDefinitions.create=false when installed with helmv3.

Thanks

dependency chart requires adding repo definition first

Hello everyone,

I just tested this action and find it very useful.

When using the ct install inside a workflow I have a problem with the dependencies.
The chart that will be installed depends on another chart and Helm expects the repository already be present.

Here is the message from the run:

Error message
Installing charts...
Version increment checking disabled.

------------------------------------------------------------------------------------------------------------------------
 Charts to be processed:
------------------------------------------------------------------------------------------------------------------------
 mychart => (version: "0.2.3", path: "./")
------------------------------------------------------------------------------------------------------------------------

Error: no repository definition for [https://chart.url/.](https://chart.url/) Please add the missing repos via 'helm repo add'
Error: Error installing charts: Error building dependencies for chart 'mychart  => (version: "0.2.3", path: "./")': Error waiting for process: exit status 1
------------------------------------------------------------------------------------------------------------------------
No chart changes detected.
------------------------------------------------------------------------------------------------------------------------
Error installing charts: Error building dependencies for chart 'mychart  => (version: "0.2.3", path: "./")': Error waiting for process: exit status 1
Error: Process completed with exit code 1.

In my local dev environment this repo to the chart is already added - but inside the runner not.
Is there any best practice how the charts can be added automatically (by ct?)?

Currently my approach would be to read out all dependencies.*.repository values from the Chart.yaml and add them in an extra step via bash.

action anticipates a given env

The action runs docker via the ct.sh command, which is not ideal because the dockerized env needs a bit of configuration. For instance in https://github.com/helm/chart-testing-action/blob/master/ct.sh#L128 only kubeconfig is copied, not the tls ca etc.

For actions that are purely js-based this is not a problem, since the action run's under whatever environment is set at the time it is launched, and for docker-based actions gh will mount a given set of directories, and pass on some env to the launched container.

Maybe we should consider going with purely js-based action, or a purely docker-based action. IMHO the latter is favourable, as chart-testing relies on a set of tooling, which is encapsulated in the image: https://github.com/helm/chart-testing/blob/master/Dockerfile.

Either that, or do a bit more work on setting up the kube-env (copy the full .kube dir, rather than only the config-file) - but there could be more traps down the road.

When running the action on self-hosted runners, it fails with:

helm.go:71: invalid configuration: unable to read certificate-authority /root/.kube/icp-global/ca.pem for icp-global due to open /root/.kube/icp-global/ca.pem: no such file or directory

Unable to get this action to work. nothing seems to happen

So basically this is what i'm trying todo:

 - name: Run chart-testing (lint)
    id: lint
    uses: helm/chart-testing-action
    with:
      command: lint
      config: ./ct.yaml

Nothing seems to work. To be upfront, i'm sorry if what i'm going to state is hurting someone's feelings, this project looks awesome, but:

I started to dig a little into it, but i can't seem to grasp what you are trying achieve. I don't get the path you are taking:

  • call node main.js
    • call main.sh
      • call ct.sh
        • start a docker container and manage it's runtime

So far from what i can see is that any possibility of using document configuration via environment variables are gone. and input variables doesn't seem to do anything at all. I'm no javascript guru, but correct me if I'm wrong: the inputs are never passed onto to main.sh as I see it? Also running the docker container detached makes it impossible to debug, what output actually comes from it.

  • Why are you using a javascript file to spawn a new process?
  • Why are we going through parsing commandline arguments twice?
  • Why are you managing the docker container runtime yourself?
  • Why not make this action a docker action?

If you wan't some input, i would love to make a pull request fixing all of the issues stated, however I don't want to put in the time if it will not be appreciated?

ct lint output crops useful information

Action output in workflow logs crops lint output about specific lines with issues

Output in the action logs:

Linting chart 'chart-1 => (version: "0.0.0", path: "charts/chart-1")'
Validating /path/to/git/repo/charts/chart-1/Chart.yaml...
Validation success! 👍
Validating maintainers...
Linting chart 'chart-2 => (version: "0.0.0", path: "charts/chart-2")'
Validating /path/to/git/repo/charts/chart-2/Chart.yaml...
Validation success! 👍
##[error][indentation] wrong indentation: expected 2 but found 4
##[error][indentation] wrong indentation: expected 2 but found 4
Error: Error linting charts: Error processing charts
------------------------------------------------------------------------------------------------------------------------
 ✖︎ chart-1 => (version: "0.0.0", path: "charts/chart-1") > Chart doesn't have maintainers
 ✖︎ chart-2 => (version: "0.0.0", path: "charts/chart-2") > Error waiting for process: exit status 1
------------------------------------------------------------------------------------------------------------------------
Error linting charts: Error processing charts
##[error]Process completed with exit code 1.

Output on local run:

Linting chart 'chart-1 => (version: "0.0.0", path: "charts/chart-1")'
Validating /path/to/git/repo/charts/chart-1/Chart.yaml...
Validation success! 👍
Validating maintainers...
Linting chart 'chart-2 => (version: "0.0.0", path: "charts/chart-2")'
Validating /path/to/git/repo/charts/chart-2/Chart.yaml...
Validation success! 👍
charts/chart-2/values.yaml
  19:5      error    wrong indentation: expected 2 but found 4  (indentation)
  20:5      error    wrong indentation: expected 2 but found 4  (indentation)

------------------------------------------------------------------------------------------------------------------------
 ✖︎ chart-1 => (version: "0.0.0", path: "charts/chart-1") > Chart doesn't have maintainers
 ✖︎ chart-2 => (version: "0.0.0", path: "charts/chart-2") > Error waiting for process: exit status 1
------------------------------------------------------------------------------------------------------------------------
Error: Error linting charts: Error processing charts
Error linting charts: Error processing charts

Extra flags via environment variables

Can you provide an example with extras arguments via environment variables?

I have been trying to pass the --validate-maintainers=false, but all my attempts were unsuccessful. The documentation mentions that it is possible to use environment variables but they seem ignored by the action.

Here is my step:

- name: Run chart-testing (lint)
   id: lint
   env:
     CT_VALIDATE_MAINTAINERS: false 
   uses: helm/chart-testing-action@master
   with:
     command: lint

Rename chart-testing-action

Since as of v2 this seems to just be a wrapper for the installation of chart-testing, would it be better to rename this something like setup-chart-testing? This may reduce some confusion about what the action does in the long run.

1.1.0 breaks ct install workflow

Running the below GitHub action workflow that spins up k3s and runs ct install against it. After upgrading chart-testing-action from v1.0.0 to v1.1.0, it fails with the below error. Downgrading back to v1.0.0 and it succeeds. Was there some breaking change that I need to adjust something?

GitHub action workflow:

name: Helm tests

on: 
  - pull_request

jobs:
  install:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Fetch history
        run: git fetch --prune --unshallow

      - name: Helm lint
        id: lint
        uses: helm/[email protected]
        with:
          command: lint
          config: .github/ct-lint.yaml

      - name: Create Kubernetes cluster
        id: k8s
        uses: debianmaster/actions-k3s@master
        if: steps.lint.outputs.changed == 'true' # Only create cluster if there are chart changes
        with:
          version: v1.17.4-k3s1

      - name: Helm install
        uses: helm/[email protected]
        if: steps.lint.outputs.changed == 'true'
        with:
          command: install
          config: .github/ct-install.yaml
          kubeconfig: ${{ steps.k8s.outputs.kubeconfig }}

Error:

2020-10-14T23:45:46.3280698Z ##[group]Run debianmaster/actions-k3s@master
2020-10-14T23:45:46.3281088Z with:
2020-10-14T23:45:46.3281364Z   version: v1.17.4-k3s1
2020-10-14T23:45:46.3281644Z ##[endgroup]
2020-10-14T23:45:46.3737099Z storing kubeconfig here /tmp/output/kubeconfig-v1.17.4-k3s1.yaml!
2020-10-14T23:45:46.3798776Z [command]/usr/bin/docker run -d --privileged --name=k3s-v1.17.4-k3s1 -e K3S_KUBECONFIG_OUTPUT=/tmp/output/kubeconfig-v1.17.4-k3s1.yaml -e K3S_KUBECONFIG_MODE=666 -v /tmp/output:/tmp/output -p 6443:6443 rancher/k3s:v1.17.4-k3s1 server
2020-10-14T23:45:46.4252207Z Unable to find image 'rancher/k3s:v1.17.4-k3s1' locally
2020-10-14T23:45:46.6718485Z v1.17.4-k3s1: Pulling from rancher/k3s
2020-10-14T23:45:46.8889841Z 2e685ecdf303: Pulling fs layer
2020-10-14T23:45:46.8892933Z a1041b1f9494: Pulling fs layer
2020-10-14T23:45:46.8893319Z 71469533cefe: Pulling fs layer
2020-10-14T23:45:46.9696861Z 71469533cefe: Verifying Checksum
2020-10-14T23:45:46.9697253Z 71469533cefe: Download complete
2020-10-14T23:45:46.9859999Z a1041b1f9494: Verifying Checksum
2020-10-14T23:45:46.9860406Z a1041b1f9494: Download complete
2020-10-14T23:45:47.4343768Z 2e685ecdf303: Verifying Checksum
2020-10-14T23:45:47.4346782Z 2e685ecdf303: Download complete
2020-10-14T23:45:48.7321915Z 2e685ecdf303: Pull complete
2020-10-14T23:45:48.7894718Z a1041b1f9494: Pull complete
2020-10-14T23:45:48.8435084Z 71469533cefe: Pull complete
2020-10-14T23:45:48.8459040Z Digest: sha256:178da7a6749a2ce420db223b83a14671f0739fcd0b76bf7d7986f147c7dd22cf
2020-10-14T23:45:48.8480445Z Status: Downloaded newer image for rancher/k3s:v1.17.4-k3s1
2020-10-14T23:45:50.9010879Z 9006c1ef9fa4267efdc05f5578ad4c28ca8e535df0978e3d804d01cd3c109bf5
2020-10-14T23:46:01.2221002Z ##[warning]The `set-env` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
2020-10-14T23:46:01.2344215Z ##[group]Run helm/[email protected]
2020-10-14T23:46:01.2344674Z with:
2020-10-14T23:46:01.2344943Z   command: install
2020-10-14T23:46:01.2345302Z   config: .github/ct-install.yaml
2020-10-14T23:46:01.2345859Z   kubeconfig: /tmp/output/kubeconfig-v1.17.4-k3s1.yaml
2020-10-14T23:46:01.2346318Z env:
2020-10-14T23:46:01.2346777Z   KUBECONFIG: /tmp/output/kubeconfig-v1.17.4-k3s1.yaml
2020-10-14T23:46:01.2347256Z ##[endgroup]
2020-10-14T23:46:01.2831207Z Running ct container...
2020-10-14T23:46:01.3688229Z b7af79d6b87bb30c9cd8c6bbdb5f3e22a7218094cbcef5274591c052766107d2
2020-10-14T23:46:01.4923176Z 
2020-10-14T23:46:01.6074070Z Version increment checking disabled.
2020-10-14T23:46:01.7907161Z Running 'ct install'...
2020-10-14T23:46:01.9037712Z Installing charts...
2020-10-14T23:46:01.9044521Z Version increment checking disabled.
2020-10-14T23:46:01.9409964Z 
2020-10-14T23:46:01.9411525Z ------------------------------------------------------------------------------------------------------------------------
2020-10-14T23:46:01.9412532Z  Charts to be processed:
2020-10-14T23:46:01.9413634Z ------------------------------------------------------------------------------------------------------------------------
2020-10-14T23:46:01.9414409Z  hedera-mirror => (version: "0.7.0-alpha1", path: "charts/hedera-mirror")
2020-10-14T23:46:01.9415095Z ------------------------------------------------------------------------------------------------------------------------
2020-10-14T23:46:01.9415285Z 
2020-10-14T23:46:03.3395831Z "bitnami" has been added to your repositories
2020-10-14T23:46:03.4561428Z "fluxcd" has been added to your repositories
2020-10-14T23:46:03.6150298Z "loki" has been added to your repositories
2020-10-14T23:46:03.8900529Z "prometheus" has been added to your repositories
2020-10-14T23:46:04.0790351Z "traefik" has been added to your repositories
2020-10-14T23:46:04.1279798Z Hang tight while we grab the latest from your chart repositories...
2020-10-14T23:46:04.2170183Z ...Successfully got an update from the "fluxcd" chart repository
2020-10-14T23:46:04.2299313Z ...Successfully got an update from the "traefik" chart repository
2020-10-14T23:46:04.2475500Z ...Successfully got an update from the "loki" chart repository
2020-10-14T23:46:04.4123264Z ...Successfully got an update from the "prometheus" chart repository
2020-10-14T23:46:05.1878822Z ...Successfully got an update from the "bitnami" chart repository
2020-10-14T23:46:05.1880078Z Update Complete. ⎈Happy Helming!⎈
2020-10-14T23:46:06.2212308Z Saving 5 charts
2020-10-14T23:46:06.2267909Z Downloading postgresql-ha from repo https://charts.bitnami.com/bitnami
2020-10-14T23:46:07.1439766Z Downloading redis from repo https://charts.bitnami.com/bitnami
2020-10-14T23:46:08.2213751Z Deleting outdated charts
2020-10-14T23:46:08.2347466Z Installing chart 'hedera-mirror => (version: "0.7.0-alpha1", path: "charts/hedera-mirror")'...
2020-10-14T23:46:08.2347918Z 
2020-10-14T23:46:08.2348799Z Installing chart with values file 'charts/hedera-mirror/ci/default-values.yaml'...
2020-10-14T23:46:08.2349279Z 
2020-10-14T23:46:08.2349902Z Creating namespace 'hedera-mirror-f7hdfcy7zx'...
2020-10-14T23:46:08.2962113Z The connection to the server localhost:8080 was refused - did you specify the right host or port?
2020-10-14T23:46:08.2962693Z ========================================================================================================================
2020-10-14T23:46:08.2962989Z ........................................................................................................................
2020-10-14T23:46:08.2963663Z ==> Events of namespace hedera-mirror-f7hdfcy7zx
2020-10-14T23:46:08.2964134Z ........................................................................................................................
2020-10-14T23:46:08.4294468Z Error printing details: Error waiting for process: exit status 1
2020-10-14T23:46:08.5112414Z Error printing logs: Error running process: exit status 1
2020-10-14T23:46:08.5114777Z Deleting release 'hedera-mirror-f7hdfcy7zx'...
2020-10-14T23:46:08.5561411Z Error deleting Helm release: Error waiting for process: exit status 1
2020-10-14T23:46:08.5562658Z Deleting namespace 'hedera-mirror-f7hdfcy7zx'...
2020-10-14T23:46:08.6619865Z Namespace 'hedera-mirror-f7hdfcy7zx' did not terminate after 180s.
2020-10-14T23:46:08.6620917Z The connection to the server localhost:8080 was refused - did you specify the right host or port?
2020-10-14T23:46:08.7649381Z Error: Error installing charts: Error processing charts
2020-10-14T23:46:08.7650885Z Namespace 'hedera-mirror-f7hdfcy7zx' terminated.
2020-10-14T23:46:08.7651620Z ------------------------------------------------------------------------------------------------------------------------
2020-10-14T23:46:08.7652444Z  ✖︎ hedera-mirror => (version: "0.7.0-alpha1", path: "charts/hedera-mirror") > Error waiting for process: exit status 1
2020-10-14T23:46:08.7654167Z ------------------------------------------------------------------------------------------------------------------------
2020-10-14T23:46:08.7654964Z Error installing charts: Error processing charts
2020-10-14T23:46:08.8014589Z Removing ct container...
2020-10-14T23:46:08.9710882Z Done!
2020-10-14T23:46:08.9835758Z Post job cleanup.

ct config:

chart-repos:
  - bitnami=https://charts.bitnami.com/bitnami
  - fluxcd=https://charts.fluxcd.io
  - loki=https://grafana.github.io/loki/charts
  - prometheus=https://prometheus-community.github.io/helm-charts
  - traefik=https://helm.traefik.io/traefik
check-version-increment: false
charts:
  - charts/hedera-mirror

Where should i set the path to the chart

HI!

I'm having a problem with the CI not correctly identifying the Chart directory

What I tried:

My workflow file:

name: Helm

on:
  pull_request:
    paths:
      - 'Charts/generic/**'
jobs:
  Lint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1

      - name: Run chart-testing (lint)
        id: lint
        uses: helm/[email protected]
        with:
          command: lint

What I hope will happen:

Run the lint only in Charts/generic directory.

How to configure this?

Directory 'charts' is not a valid chart directory. Skipping...

not getting what the real problem I am getting this message while running the action is.

  • I had created a charts repo that contains all helm charts
  • but when I run wf it gave me this error
  if [[ -n "$changed" ]]; then
    echo "::set-output name=changed::true"
  fi
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/[3](https://github.com/Anugrahchaturvedi/wftest/runs/6401328577?check_suite_focus=true#step:6:3).7.13/x6[4](https://github.com/Anugrahchaturvedi/wftest/runs/6401328577?check_suite_focus=true#step:6:4)
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.13/x64/lib
    CT_CONFIG_DIR: /opt/hostedtoolcache/ct/v3.[5](https://github.com/Anugrahchaturvedi/wftest/runs/6401328577?check_suite_focus=true#step:6:5).1/x8[6](https://github.com/Anugrahchaturvedi/wftest/runs/6401328577?check_suite_focus=true#step:6:6)_64/etc
    VIRTUAL_ENV: /opt/hostedtoolcache/ct/v3.5.1/x[8](https://github.com/Anugrahchaturvedi/wftest/runs/6401328577?check_suite_focus=true#step:6:8)6_64/venv
Directory 'charts' is not a valid chart directory. Skipping...
Directory 'charts/templates' is not a valid chart directory. Skipping...
Directory 'charts/templates' is not a valid chart directory. Skipping...
Directory 'charts/templates' is not a valid chart directory. Skipping...
Directory 'charts/templates' is not a valid chart directory. Skipping...
Directory 'charts/templates' is not a valid chart directory. Skipping...
Directory 'charts/templates' is not a valid chart directory. Skipping...
Directory 'charts/templates' is not a valid chart directory. Skipping...
Directory 'charts/templates/tests' is not a valid chart directory. Skipping...
Directory 'charts' is not a valid chart directory. Skipping...```


so I'm not getting what I am doing wrong , can anyone help?

ct lint fails with chart that has dependencies

Hello,

I'm seeing the issue below when using this [email protected] to set up the environment and then run ct lint --target-branch main --chart-dirs . . Please keep in mind the root chart depends on a local version of prometheus-postgres-exporter as a subchart

Run ct lint --target-branch main --chart-dirs .
  ct lint --target-branch main --chart-dirs .
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.7.[1](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:1)[3](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:3)/x6[4](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:4)
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.13/x64/lib
    CT_CONFIG_DIR: /opt/hostedtoolcache/ct/v3.[5](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:5).1/x8[6](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:6)_64/etc
    VIRTUAL_ENV: /opt/hostedtoolcache/ct/v3.5.1/x[8](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:8)6_64/venv
Linting charts...
Directory '.github/workflows' is not a valid chart directory. Skipping...

------------------------------------------------------------------------------------------------------------------------
 Charts to be processed:
------------------------------------------------------------------------------------------------------------------------
 common-service => (version: "0.[9](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:9).1", path: "common-service")
------------------------------------------------------------------------------------------------------------------------

Saving 1 charts
Save error occurred:  directory common-service/charts/prometheus-postgres-exporter not found
Deleting newly downloaded charts, restoring pre-update state
Error: Error linting charts: Error building dependencies for chart 'common-service => (version: "0.9.1", path: "common-service")': Error waiting for process: exit status 1
Error: directory common-service/charts/prometheus-postgres-exporter not found
------------------------------------------------------------------------------------------------------------------------
No chart changes detected.
------------------------------------------------------------------------------------------------------------------------
Error linting charts: Error building dependencies for chart 'common-service => (version: "0.9.1", path: "common-service")': Error waiting for process: exit status 1
Error: Process completed with exit code 1.

When I run the same locally, it works fine

Linting charts...
Directory '.github/workflows' is not a valid chart directory. Skipping...

------------------------------------------------------------------------------------------------------------------------
 Charts to be processed:
------------------------------------------------------------------------------------------------------------------------
 common-service => (version: "0.9.1", path: "common-service")
------------------------------------------------------------------------------------------------------------------------

Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "prometheus-community" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Deleting outdated charts
Linting chart 'common-service => (version: "0.9.1", path: "common-service")'
Checking chart 'common-service => (version: "0.9.1", path: "common-service")' for a version bump...
Old chart version: 0.9.0
New chart version: 0.9.1
Chart version ok.
Validating /Users/***/Workspace/helm-charts/common-service/Chart.yaml...
Validation success! 👍
Validating maintainers...
==> Linting common-service
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, 0 chart(s) failed
------------------------------------------------------------------------------------------------------------------------
 ✔︎ common-service => (version: "0.9.1", path: "common-service")
------------------------------------------------------------------------------------------------------------------------
All charts linted successfully

Any ideas? I far as I know ct lint runs helm dep update before linting which should be enough to package the subchart based on the sources.

May be related to #85

Error: Error running process: exit status 128

I've tried with command: lint and command: ct lint but it returns the same error message. When downloading the container quay.io/helmpack/chart-testing:v3.0.0-beta.2 and running that locally it works fine.

2020-03-24T04:07:43.8989222Z ##[group]Run helm/[email protected]
2020-03-24T04:07:43.8989363Z with:
2020-03-24T04:07:43.8989638Z   command: ct lint
2020-03-24T04:07:43.8989740Z ##[endgroup]
2020-03-24T04:07:44.8614936Z Unable to find image 'quay.io/helmpack/chart-testing:v3.0.0-beta.2' locally
2020-03-24T04:07:44.8615427Z v3.0.0-beta.2: Pulling from helmpack/chart-testing
2020-03-24T04:07:44.8615555Z 4167d3e14976: Already exists
2020-03-24T04:07:44.8615682Z 1ef3c023a7f3: Pulling fs layer
2020-03-24T04:07:44.8615802Z aa9784039bf9: Pulling fs layer
2020-03-24T04:07:44.8615975Z 9fb091bb96bc: Pulling fs layer
2020-03-24T04:07:44.8616094Z 92dd9035358e: Pulling fs layer
2020-03-24T04:07:44.8616211Z b510c65bb643: Pulling fs layer
2020-03-24T04:07:44.8616329Z e38e83ea3725: Pulling fs layer
2020-03-24T04:07:44.8616446Z e28434c59fed: Pulling fs layer
2020-03-24T04:07:44.8616562Z 669220e465b9: Pulling fs layer
2020-03-24T04:07:44.8616681Z 92dd9035358e: Waiting
2020-03-24T04:07:44.8616820Z b510c65bb643: Waiting
2020-03-24T04:07:44.8616942Z e38e83ea3725: Waiting
2020-03-24T04:07:44.8617215Z e28434c59fed: Waiting
2020-03-24T04:07:44.8617325Z 669220e465b9: Waiting
2020-03-24T04:07:44.8617424Z Running ct container...
2020-03-24T04:07:44.9761611Z 9fb091bb96bc: Verifying Checksum
2020-03-24T04:07:44.9790200Z 9fb091bb96bc: Download complete
2020-03-24T04:07:45.0106708Z aa9784039bf9: Download complete
2020-03-24T04:07:45.2347267Z 92dd9035358e: Verifying Checksum
2020-03-24T04:07:45.2347604Z 92dd9035358e: Download complete
2020-03-24T04:07:45.5748744Z b510c65bb643: Verifying Checksum
2020-03-24T04:07:45.5749420Z b510c65bb643: Download complete
2020-03-24T04:07:45.6627402Z e28434c59fed: Verifying Checksum
2020-03-24T04:07:45.6627884Z e28434c59fed: Download complete
2020-03-24T04:07:46.0014892Z 669220e465b9: Verifying Checksum
2020-03-24T04:07:46.5213361Z 669220e465b9: Download complete
2020-03-24T04:07:46.5213566Z 1ef3c023a7f3: Verifying Checksum
2020-03-24T04:07:46.5213676Z 1ef3c023a7f3: Download complete
2020-03-24T04:07:46.5485427Z e38e83ea3725: Verifying Checksum
2020-03-24T04:07:46.5485748Z e38e83ea3725: Download complete
2020-03-24T04:07:47.5370394Z 1ef3c023a7f3: Pull complete
2020-03-24T04:07:47.6070731Z aa9784039bf9: Pull complete
2020-03-24T04:07:47.6772049Z 9fb091bb96bc: Pull complete
2020-03-24T04:07:48.1416652Z 92dd9035358e: Pull complete
2020-03-24T04:07:48.4836225Z b510c65bb643: Pull complete
2020-03-24T04:07:48.5206614Z e38e83ea3725: Pull complete
2020-03-24T04:07:48.5549347Z e28434c59fed: Pull complete
2020-03-24T04:07:48.6950898Z 669220e465b9: Pull complete
2020-03-24T04:07:48.6999781Z Digest: sha256:332de299264f509cd44b8707a9805baa98dcaf7289ba63a846c91345d06fbb4d
2020-03-24T04:07:48.7033479Z Status: Downloaded newer image for quay.io/helmpack/chart-testing:v3.0.0-beta.2
2020-03-24T04:07:51.2919570Z 6e0d06200face22ef3251c0da6e15285463cbc4b426ad492d18883422c6428e6
2020-03-24T04:07:51.5665945Z 
2020-03-24T04:07:51.7676671Z Error: Error running process: exit status 128
2020-03-24T04:07:51.7685013Z Usage:
2020-03-24T04:07:51.7686084Z   ct list-changed [flags]
2020-03-24T04:07:51.7686315Z 
2020-03-24T04:07:51.7686748Z Aliases:
2020-03-24T04:07:51.7687089Z   list-changed, ls-changed, lsc
2020-03-24T04:07:51.7687190Z 
2020-03-24T04:07:51.7687262Z Flags:
2020-03-24T04:07:51.7687542Z       --chart-dirs strings        Directories containing Helm charts. May be specified multiple times
2020-03-24T04:07:51.7687665Z                                   or separate values with commas (default [charts])
2020-03-24T04:07:51.7688067Z       --config string             Config file
2020-03-24T04:07:51.7688523Z       --excluded-charts strings   Charts that should be skipped. May be specified multiple times
2020-03-24T04:07:51.7689001Z                                   or separate values with commas
2020-03-24T04:07:51.7689250Z   -h, --help                      help for list-changed
2020-03-24T04:07:51.7689903Z       --remote string             The name of the Git remote used to identify changed charts (default "origin")
2020-03-24T04:07:51.7690491Z       --target-branch string      The name of the target branch used to identify changed charts (default "master")
2020-03-24T04:07:51.7690590Z 
2020-03-24T04:07:51.7944480Z Removing ct container...
2020-03-24T04:07:51.9874686Z Done!

No chart changes detected

Hey, I'm probably messing something up here, but every run of the action on my chart repo is saying that nothing has changed when it has.

Take for instance this run:
https://github.com/SapiensAnatis/helm-charts/actions/runs/4033008969

which was triggered by this commit:
SapiensAnatis/helm-charts@4728958

It says that nothing has changed when I've clearly updated one of the templates. Additionally, I think my directory structure is sound, with

Git repository
├───.github
│   └───workflows
└───charts
    └───dragalia-api
        ├───charts
        └───templates
            └───tests

Feel free to look at the repo itself but summarily the chart depends on two bitnami charts (redis and postgresql) and has the following ct.yaml

remote: origin
chart-dirs:
  - charts
chart-repos:
  - bitnami=https://charts.bitnami.com/bitnami
helm-extra-args: --timeout 600s

When I run the same command that the action is running, ct list-changed --target-branch master --config ct.yaml --remote=origin after making a change, I see the chart in the list of changes so not sure what's going on

Example in README.md does not work

  1. The "Run chart-testing (install)" job in the example starts without changes even though the cluster only starts if changes are detected.
  2. The "Run chart-testing (install)" job needs a target branch to run. By default `ct install´ only runs on changes and therefore it needs a reference

Unable to find version v2.0.0

The last released version is v1.1.0, but the example in README.md (main branch) already points to version v2.0.0 which can't be found.

 Getting action download info
Failed to resolve action download info. Error: Unable to resolve action `helm/[email protected]`, unable to find version `v2.0.0`
Retrying in 27.77 seconds
Failed to resolve action download info. Error: Unable to resolve action `helm/[email protected]`, unable to find version `v2.0.0`
Retrying in 28.988 seconds
Error: Unable to resolve action `helm/[email protected]`, unable to find version `v2.0.0`

-- Sven

empty response

Hi,

following command always return empty result, whereas I did some some changes to my chart :

this command is run when I am in the 'develop' branch

$ ct list-changed --config .github/ct-config.yaml --target-branch main
charts/mychartfoldername

any help appreciated !

D.

Document how to test charts that contains a CRD

Hi,

I am trying to test a chart that contains some Istio resources and the ct install action will fail. I have two options:

  1. install the Istio operator as a step in the CI/CD pipeline on the kind cluster before running the tests
  2. declare Istio as a dependency of this chart, but enable that only during execution of tests (the helm chart is meant to be used on a cluster where Istio is already installed)

As I tried to do 1. I wasn't able to retrieve the kubeconfig from the create-kind github action and pass it down:

      - name: Create kind cluster
        uses: helm/[email protected]
        # if: steps.list-changed.outputs.changed == 'true'

      - name: Install Istio
        uses: huang195/[email protected]
        with:
          # kubeconfig: "${{steps.kubeconfig.outputs.config}}"
          istio version: '1.6.3'

Am I following the right approach? Is the approach of declaring a test dependency the right one? How I should declare also a test CRD (an istio Gateway, for example?)

No .kube directory found

I've run into an issue where I get the error "No .kube directory found". Thanks to the discussion on #18, I know that the issue is that I am passing options directly to the command like the following:

- name: Run chart-testing (install)
  uses: helm/[email protected]    
  command: install --helm-repo-extra-args "bw-helm=--username ${{ secrets.ARTIFACTORY_USERNAME }} --password ${{ secrets.ARTIFACTORY_PASSWORD }}"
  config: ct.yaml

Note that I do actually use the ct.yaml file to pass most of my configuration, however I didn't want to commit secrets to source so I attempted to put them in the command. Is there some way we can pass arguments to the command that are either variable or sensative in nature?

ct.yaml placed in root of the repository is not being picked

Versions:

Run helm/[email protected]
  with:
    version: v3.5.0
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.7.12/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.12/x64/lib

I had placed ct.yaml in the root of the project but it was not being picked up by ct.
However, when I pass those same from the environment variables or pass config file in CLI using --config ct.yaml, it works.

gzip: stdin: not in gzip format

My workflow has failed multiple times when invoking ct.sh with the below error. My guess is that the chart-testing artifact retrieval fails and is incomplete so the subsequent untar fails. Of course, nothing this action can do if GitHub artifacts timeout but I think we can build in some resiliency to the script. Can we perhaps add --retry 5 --retry-delay 1 to the curl command?

Run helm/[email protected]
  with:
    version: v3.7.1
    yamllint_version: 1.[2](https://github.com/hashgraph/hedera-mirror-node/actions/runs/4287672375/jobs/7469131183#step:7:2)7.1
    yamale_version: [3](https://github.com/hashgraph/hedera-mirror-node/actions/runs/4287672375/jobs/7469131183#step:7:3).0.[4](https://github.com/hashgraph/hedera-mirror-node/actions/runs/4287672375/jobs/7469131183#step:7:4)
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.[6](https://github.com/hashgraph/hedera-mirror-node/actions/runs/4287672375/jobs/7469131183#step:7:6)-10/x64
    JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.6-10/x64
    GRADLE_BUILD_ACTION_SETUP_COMPLETED: true
    GRADLE_BUILD_ACTION_CACHE_RESTORED: true
Run cd $GITHUB_ACTION_PATH \
  cd $GITHUB_ACTION_PATH \
  && ./ct.sh \
      --version v3.7.1 \
      --yamllint-version 1.27.1 \
      --yamale-version 3.0.4
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/1[7](https://github.com/hashgraph/hedera-mirror-node/actions/runs/4287672375/jobs/7469131183#step:7:7).0.6-10/x64
    JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.6-10/x64
    GRADLE_BUILD_ACTION_SETUP_COMPLETED: true
    GRADLE_BUILD_ACTION_CACHE_RESTORED: true
Installing chart-testing...

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Error: Process completed with exit code 2.

How to add private repo for dependencies

Hi,

in my charts i have dependencies to private repositories. I've tried a lot, but couldn't find a way to set up access for helm to download the defined dependencies during the helm lint command.
Is there a way through the config command or through environment variables?

Many thanks

Workflow justification for "No chart changes detected" fast end

Hi,

I'm unsure why "No chart changes detected" fast stop is the best workflow. Can you talk about this more? We put our helm charts with our service code. Other people do that to (flux is one example: https://github.com/fluxcd/flux/tree/master/chart)

It makes sense to me to try starting and testing our helm chart on every PR. We may only modify the helm chart version infrequently, but we would want to know on each PR if the code will break the helm chart. I imagine this would be the desired workflow for most people. I'm maybe misunderstanding something about why this would be undesired or not want to be the default.

I imagine this is related to #12

Be able to run without the ct.yaml config file

First of all, this tool is super nice, thanks!

It would be tidier if we could run it without the ct.yaml. I tried these, both don't work:

      - name: Run chart-testing (lint)
        id: lint
        uses: helm/[email protected]
        with:
          command: lint --chart-dirs stable
      - name: Run chart-testing (lint)
        id: lint
        uses: helm/[email protected]
        with:
          command: lint
        env:
          CT_CHART_DIRS: stable

I know env vars is covered in #35 but perhaps there's another way?

Chart Running Faliure

I'm trying to run a chart using this action,
but it fails,
here is the log you see for ref:
https://github.com/saikatharryc/helm/pull/1/checks?check_run_id=597342989

I'm confused a bit, as it first says that no space left on device while pulling. but not that, I have set
imagePullPolicy: IfNotPresent , now just after that error, I get already present on machine so pulled.
I'm not sure whats the exact issue is happening.

Note: as far as I know Github actions gives 20GB of disk space (i might be wrong as well) and the image is a bit heavy, which I'm pulling.

can I get any help from here to understand how to debug this or what I'm doing wrong maybe?

Error: failed installing charts: failed identifying charts to process: failed running process: exit status 128

Hi,

I'm trying to use this but it fails on:

  ct install
  shell: /usr/bin/bash -e {0}
  env:
    HELM_VERSION: 3.10.1
    pythonLocation: /opt/hostedtoolcache/Python/3.11.0/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.0/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.0/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.0/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.0/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.0/x64/lib
    CT_CONFIG_DIR: /opt/hostedtoolcache/ct/v3.7.1/x86_64/etc
    VIRTUAL_ENV: /opt/hostedtoolcache/ct/v3.7.1/x86_64/venv
Installing charts...
Error: failed installing charts: failed identifying charts to process: failed running process: exit status 128
------------------------------------------------------------------------------------------------------------------------
No chart changes detected.
------------------------------------------------------------------------------------------------------------------------
failed installing charts: failed identifying charts to process: failed running process: exit status 128
Error: Process completed with exit code 1.

My wokrflow:


env:
  HELM_VERSION: 3.10.1

on:
  pull_request:
    branches: [ "main" ]

  workflow_dispatch:

jobs:
  lint-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Set up Helm
        uses: azure/setup-helm@v3
        with:
          version: v${{ env.HELM_VERSION }}
      - uses: actions/setup-python@v4
        with:
          python-version: '3.11'
      - name: Set up chart-testing
        uses: helm/[email protected]
      - name: Run chart-testing (list-changed)
        id: list-changed
        run: |
          changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
          if [[ -n "$changed" ]]; then
            echo "::set-output name=changed::true"
          fi
      - name: Run chart-testing (lint)
        run: ct lint --validate-maintainers=false --target-branch ${{ github.event.repository.default_branch }}
      - name: Create kind cluster
        uses: helm/[email protected]
        if: steps.list-changed.outputs.changed == 'true'
      - name: Run chart-testing (install)
        run: ct install

Add Mayor version tags to be pinned by actions

A quite common pattern on actions is to have a mayor version tag like v2 that will be pointing to the latest release of that mayor. This makes possible to configure the GH workflows pointing to that latest.

jobs:
  chart-lint:
    name: Helm chart Lint
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: helm/chart-testing-action@v2

yamllint not reporting line numbers

I noticed that ct lint calls yamllint to validate Chart.yaml, but when it spots a warning or an error, it doesn't tell you which line it is:

>>> yamllint --config-file /home/runner/_work/_tool/ct/v3.3.0/x86_64/etc/lintconf.yaml mychart/Chart.yaml
Error: [comments] too few spaces before comment
Error: Error linting charts: Error processing charts

Conversely, yamllint itself in its default configuration reports the line number:

yamllint b2c-perf-test-client/Chart.yaml 
b2c-perf-test-client/Chart.yaml
  1:1       warning  missing document start "---"  (document-start)
  26:14     warning  too few spaces before comment  (comments)

Either:
How do we get ct lint to report line numbers,
or
Can you configure lintconf.yaml to report line numbers by default ?

Additionally, it may be the case where your lintconf.yaml is reporting warnings as errors, as yamllint 1.26.1 only reported the comment issue as a warning and not an error.

Provide a helpful error when the target-branch is wrongly configured

I created a new repository, and named the master branch main. Running the lint command failed with a weird error message:

…
Digest: sha256:b7bb1e485c9a7ff67f448ebf9bb54db2cf49150b4f71a3620a87b8f85c32d2d4
Status: Downloaded newer image for quay.io/helmpack/chart-testing:v3.0.0
01ae6f5ccb65b12eb7faa050bcf39fb8526bca8866fb88eecf556e06af7ed699

Error: Error running process: exit status 128
Removing ct container...
Done!

I took me a while to figure out that the linter requires a default branch named master. I know it is possible to re-configure using:

target-branch: main

However, I think that:

  • There should be a proper warning: Branch "master" not found
  • There should be some prominent piece of documentation

The `changed` in step `list-changed` will always be true

The output of ct list-changed will have other strings even if the chart is not changed.

          changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
          if [[ -n "$changed" ]]; then
            echo "::set-output name=changed::true"
          fi
Linting charts...
>>> helm version --template {{ .Version }}
>>> git rev-parse --is-inside-work-tree
>>> git merge-base origin/main HEAD
>>> git diff --find-renames --name-only c8b9381a98059c07b5b65510b8162c5df3f43cd0 -- charts

And those strings will make the if check always true. So that's why we will meet errors like this issue.

Helm v3 support

I can configure the action to use the 3.0.0-beta.1 chart-testing image which contains Helm v3.0.1 by setting jobs.lint-test[].with.image=quay.io/helmpack/chart-testing:v3.0.0-beta.1 as follows.

# ...
jobs:
  lint-test:
    steps:
      # ...
      - name: Run chart-testing (lint)
        id: lint
        uses: helm/[email protected]
        with:
          command: lint
          image: quay.io/helmpack/chart-testing:v3.0.0-beta.1

The cr.sh still tries to run helm init --client-only leading to Error: unknown flag: --client-only.

It looks like cr.sh needs to be updated to support Helm v3. My guess is that the script would need some refactoring in the helm_init as well as with the install_tiller function being called.

At a glance it looks like the refactoring should either switch to just supporting Helm v3 or it should try to figure out what version of Helm is available and adapt what is needed for the installed version.

Are there any plans to change this? I'd be happy to lend a hand if someone can clarify in which direction you'd like the refactor to go.

This is probably a partial duplicate of helm/chart-testing#188 (looking at helm/chart-testing#188 (comment)).

Using services while testing charts

Is it possible to use services like postgresql while testing charts? Working on a chart that relies on an external postgresql not included in the chart. And it is required by the software running inside the container

ct.yaml in workdir overrides "config:"

I have a ct.yaml in the root of my repo and want to override this for a particular step. I tried this:

    - name: Run chart-testing (lint)
      id: lint
      uses: helm/[email protected]
      with:
        command: lint
        config: test-suite.ct.yaml

This means:

  • test-suite.ct.yaml file is mounted to /etc/ct/ct.yaml inside the container
  • /workdir inside the container contains the ct.yaml from the root of my repo

Due to the precedence rules of chart-testing config files the /workdir/ct.yaml is used instead of /etc/ct/ct.yaml. This was surprising to me.

It seems like reasonable behaviour once I understood what's going on, but it's something of a gotcha. Would you accept a PR documenting this behaviour in the README?

Script download wrong binary

Hi,

I use this action on aarch64 host to try my chart.

Seems the script pull the wrong ct binary.
Get ./ct.sh: line 132: /opt/hostedtoolcache/ct/v3.8.0/aarch64/ct: cannot execute binary file: Exec format error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.