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

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

Closed
poconnor-lab49 opened this issue Aug 29, 2022 · 4 comments
Labels

Comments

@poconnor-lab49
Copy link

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:

@NicholasFiorentini
Copy link

Same issue. I was using docker run -it --rm --workdir=/data --volume "$(PWD):/data" quay.io/helmpack/chart-testing:v3.8.0 ct lint --all --config ct.yaml and suddenly it stopped working, without any apparent update to the docker image.

Adding the safe.directory option solved it.

Copy link

github-actions bot commented Nov 6, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Nov 6, 2023
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2023
@cornfeedhobo
Copy link

cornfeedhobo commented Dec 27, 2023

For future readers, you have three options:

  • use the --validate-maintainers=false flag

  • set the validate-maintainers: false value in your config

  • use this terrible wrapper script

     KUBE_CONFIG="${KUBE_CONFIG:-$HOME/.kube/config}"
     
     docker run \
     	--rm \
     	--tty \
     	--interactive \
     	--network='host' \
     	--workdir='/charts' \
     	--volume="$PWD:/charts" \
     	--volume="$KUBE_CONFIG:/root/.kube/config:ro" \
     	quay.io/helmpack/chart-testing \
     		/bin/sh -c "\
     			git config --global --add safe.directory /charts
     			ct ${*}
     		"

I recommend disabling validation over the wrapper, because the wrapper is not consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants