chart-testing icon indicating copy to clipboard operation
chart-testing copied to clipboard

`ct lint` in docker image errors out with "Could not parse git repository domain for 'origin'"

Open poconnor-lab49 opened this issue 3 years ago • 0 comments

Is this a request for help?:

No


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

BUG REPORT, maybe just documentation update needed?

Version of Helm and Kubernetes:

Whatever comes with quay.io/helmpack/chart-testing:v3.7.0

What happened: ct lint fails when using the docker image

$ docker run -it --workdir=/data --volume $(pwd):/data quay.io/helmpack/chart-testing:v3.7.0 ct lint --chart-dirs . --all
Linting charts...
Version increment checking disabled.

------------------------------------------------------------------------------------------------------------------------
 Charts to be processed:
------------------------------------------------------------------------------------------------------------------------
 myapppoc => (version: "1.0.0", path: "myapp")
 myapp-api => (version: "0.1.0", path: "myapp-api")
 myapp-grpc => (version: "0.1.0", path: "myapp-grpc")
------------------------------------------------------------------------------------------------------------------------

Linting chart 'myapppoc => (version: "1.0.0", path: "myapp")'
Validating /data/myapp/Chart.yaml...
Validation success! 👍Validating maintainers...
Linting chart 'myapp-api => (version: "0.1.0", path: "myapp-api")'
Validating /data/myapp-api/Chart.yaml...
Validation success! 👍Validating maintainers...
Linting chart 'myapp-grpc => (version: "0.1.0", path: "myapp-grpc")'
Validating /data/myapp-grpc/Chart.yaml...
Validation success! 👍Validating maintainers...
------------------------------------------------------------------------------------------------------------------------
 ✖︎ myapppoc => (version: "1.0.0", path: "myapp") > Chart doesn't have maintainers
 ✖︎ myapp-api => (version: "0.1.0", path: "myapp-api") > Could not parse git repository domain for 'origin'
 ✖︎ myapp-grpc => (version: "0.1.0", path: "myapp-grpc") > Could not parse git repository domain for 'origin'
------------------------------------------------------------------------------------------------------------------------
Error: Error linting charts: Error processing charts
Error linting charts: Error processing charts

What you expected to happen: ct lint does not error on git domain

How to reproduce it (as minimally and precisely as possible): From a the root of a repository which contains charts, execute

docker run -it --workdir=/data --volume $(pwd):/data quay.io/helmpack/chart-testing:v3.7.0 ct lint --chart-dirs . --all

Anything else we need to know:

Workaround:

Use the git config safe.directory option. I have no idea if this is actually a good plan, but it works.

docker run -it --workdir=/data --volume $(pwd):/data quay.io/helmpack/chart-testing:v3.7.0 /bin/sh -c "git config --global --add safe.directory /data; ct lint --chart-dirs . --all"

See also:

  • https://github.com/actions/runner/issues/2033
  • https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory

poconnor-lab49 avatar Aug 29 '22 22:08 poconnor-lab49