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

1.1.0 breaks ct install workflow #56

Closed
steven-sheehy opened this issue Oct 15, 2020 · 7 comments
Closed

1.1.0 breaks ct install workflow #56

steven-sheehy opened this issue Oct 15, 2020 · 7 comments
Assignees

Comments

@steven-sheehy
Copy link
Contributor

steven-sheehy commented Oct 15, 2020

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/chart-testing-action@v1.1.0
        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/chart-testing-action@v1.1.0
        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/chart-testing-action@v1.1.0
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
@davidkarlsen
Copy link
Member

Chart testing runs as a container, so I wonder about the endpoint localhost:8080. Unless localhost is actually both the host running docker as the container and hosting the k8s api endpoint it won't work.

One thing you can experiment with though is to keep the updated action version, but downgrade the ct image: https://github.com/helm/chart-testing-action/blob/master/README.md#L21 - to see if that changes anything.

@steven-sheehy
Copy link
Contributor Author

localhost:8080 is the default in ~/.kube/config up until 1.18. So this means chart-testing-action@v1.1.0 is not using the custom kubeconfig I'm passing via --kubeconfig and is using the default, which of course won't work.

I tested it with helm/chart-testing-action@v1.1.0 and image: quay.io/helmpack/chart-testing:v3.0.0 and it fails with the below error. I tested it with helm/chart-testing-action@v1.0.0 and image: quay.io/helmpack/chart-testing:v3.1.1 and it succeeds.

Run helm/chart-testing-action@v1.1.0
  with:
    command: install
    config: .github/ct-install.yaml
    image: quay.io/helmpack/chart-testing:v3.0.0
    kubeconfig: /tmp/output/kubeconfig-v1.17.4-k3s1.yaml
  env:
    KUBECONFIG: /tmp/output/kubeconfig-v1.17.4-k3s1.yaml
Running ct container...
48e699207b18c61aebbeec1df6857443cb2b938e34274ba1fd3931245772841a

Running 'ct install'...
Installing charts...
Using config file:  /etc/ct/ct.yaml
Version increment checking disabled.
------------------------------------------------------------------------------------------------------------------------
 Configuration
------------------------------------------------------------------------------------------------------------------------
Remote: origin
TargetBranch: master
Since: HEAD
BuildId: 
LintConf: /etc/ct/lintconf.yaml
ChartYamlSchema: /etc/ct/chart_schema.yaml
ValidateMaintainers: false
ValidateChartSchema: false
ValidateYaml: false
CheckVersionIncrement: false
ProcessAllCharts: false
Charts: [charts/hedera-mirror]
ChartRepos: [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]
ChartDirs: [charts]
ExcludedCharts: []
HelmExtraArgs: 
HelmRepoExtraArgs: []
Debug: false
Upgrade: false
SkipMissingValues: false
Namespace: 
ReleaseLabel: app.kubernetes.io/instance
------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------
 Charts to be processed:
------------------------------------------------------------------------------------------------------------------------
 hedera-mirror => (version: "0.7.0-alpha1", path: "charts/hedera-mirror")
------------------------------------------------------------------------------------------------------------------------

"bitnami" has been added to your repositories
"fluxcd" has been added to your repositories
"loki" has been added to your repositories
"prometheus" has been added to your repositories
"traefik" has been added to your repositories
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "traefik" chart repository
...Successfully got an update from the "loki" chart repository
...Successfully got an update from the "fluxcd" chart repository
...Successfully got an update from the "prometheus" chart repository
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 5 charts
Downloading postgresql-ha from repo https://charts.bitnami.com/bitnami
Downloading redis from repo https://charts.bitnami.com/bitnami
Deleting outdated charts
Installing chart 'hedera-mirror => (version: "0.7.0-alpha1", path: "charts/hedera-mirror")'...

Installing chart with values file 'charts/hedera-mirror/ci/default-values.yaml'...

Creating namespace 'hedera-mirror-nc1x0zahxl'...
error: Missing or incomplete configuration info.  Please point to an existing, complete config file:

  1. Via the command-line flag --kubeconfig
  2. Via the KUBECONFIG environment variable
  3. In your home directory as ~/.kube/config

To view or setup config directly use the 'config' command.
========================================================================================================================
........................................................................................................................
==> Events of namespace hedera-mirror-nc1x0zahxl
........................................................................................................................
error: Missing or incomplete configuration info.  Please point to an existing, complete config file:

  1. Via the command-line flag --kubeconfig
  2. Via the KUBECONFIG environment variable
  3. In your home directory as ~/.kube/config

To view or setup config directly use the 'config' command.
Error printing details: Error waiting for process: exit status 1
Error printing logs: Error running process: exit status 1
Deleting release 'hedera-mirror-nc1x0zahxl'...
Error: Kubernetes cluster unreachable
Error deleting Helm release: Error waiting for process: exit status 1

So it seems the problem is located in chart-testing-action. Most likely due to the removal of the docker_exec sh -c 'mkdir -p /root/.kube' in this commit?

@davidkarlsen
Copy link
Member

Hm, the copy should copy the whole directory after that change, and not only the kubeconfig file - which was the reason for the change in #46 - how does the contents of the directory which "${{ steps.k8s.outputs.kubeconfig }}" reside in look like?

@davidkarlsen
Copy link
Member

@steven-sheehy ping? any update - or did you get it to work?

@steven-sheehy
Copy link
Contributor Author

No, it still doesn't work. I worked around it by downgrading to 1.0.0. Here's the ls output you requested:

Run ls -la "/tmp/output/kubeconfig-v1.17.4-k3s1.yaml"
-rw-rw-rw- 1 root root 1052 Oct 23 23:45 /tmp/output/kubeconfig-v1.17.4-k3s1.yaml

@davidkarlsen
Copy link
Member

This should solve itself with v2.0.0 as it simply installs and makes ct avail from PATH.

@davidkarlsen davidkarlsen self-assigned this Nov 13, 2020
@davidkarlsen
Copy link
Member

Closing this as it was fixed in v2.x

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

2 participants