argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
16.81k stars 5.09k forks source link

A number of make commands (e.g. `make codegen`) show fatals "detected dubious ownership in repository" #18973

Open andrii-korotkov-verkada opened 1 week ago

andrii-korotkov-verkada commented 1 week ago

Checklist:

Describe the bug

When running some make commands, there are issues due to argo-cd repository ownership fatal: detected dubious ownership in repository at '/go/src/github.com/argoproj/argo-cd'. Sometimes it doesn't fail the command completely, e.g. make codegen keeps progressing.

To Reproduce

Run commands from https://argo-cd.readthedocs.io/en/stable/developer-guide/toolchain-guide/#build-your-code-and-run-unit-tests

make test-tools-image
make dep-ui
make mod-download
make mod-vendor

Then run

make codegen

Expected behavior

There's no fatal error when running subcommands.

Screenshots

Screenshot 2024-07-07 at 2 03 07 PM

Version

Master + several cherry-picked commits (https://github.com/argoproj/argo-cd/pull/18694, https://github.com/argoproj/argo-cd/pull/18972)

Logs

docker run --rm -it --name argocd-test-client -u 502:20 -e HOME=/home/user -e GOPATH=/go -e ARGOCD_E2E_K3S= -e GITHUB_TOKEN -e GOCACHE=/tmp/go-build-cache -e ARGOCD_LINT_GOGC=20 -v "/Users/andrii.korotkov/go/src:/go/src:delegated" -v /Users/andrii.korotkov/go/pkg/mod:/go/pkg/mod:delegated -v /Users/andrii.korotkov/.cache/go-build:/tmp/go-build-cache:delegated -v /Users/andrii.korotkov/.kube:/home/user/.kube:delegated -v /tmp:/tmp:delegated -w /go/src/github.com/argoproj/argo-cd  argocd-test-tools:latest bash -c "make codegen-local"
fatal: detected dubious ownership in repository at '/go/src/github.com/argoproj/argo-cd'
To add an exception for this directory, call:

    git config --global --add safe.directory /go/src/github.com/argoproj/argo-cd
fatal: detected dubious ownership in repository at '/go/src/github.com/argoproj/argo-cd'
To add an exception for this directory, call:

    git config --global --add safe.directory /go/src/github.com/argoproj/argo-cd
fatal: detected dubious ownership in repository at '/go/src/github.com/argoproj/argo-cd'
To add an exception for this directory, call:

    git config --global --add safe.directory /go/src/github.com/argoproj/argo-cd
andrii-korotkov-verkada commented 1 week ago

And make codegen failed anyways with

Getting updates for unmanaged Helm repositories...
...Unable to get an update from the "https://dandydeveloper.github.io/charts" chart repository:
    open /home/user/.cache/helm/repository/helm-manager-97a7e3aa4edbf42bb12d1f82bdf04f5b4e1d13793554e4ca19cfa6376b880787-index.yaml: no such file or directory
Error: no cached repository for helm-manager-97a7e3aa4edbf42bb12d1f82bdf04f5b4e1d13793554e4ca19cfa6376b880787 found. (try 'helm repo update'): open /home/user/.cache/helm/repository/helm-manager-97a7e3aa4edbf42bb12d1f82bdf04f5b4e1d13793554e4ca19cfa6376b880787-index.yaml: no such file or directory
make: *** [Makefile:279: manifests-local] Error 1
make: *** [codegen] Error 2