argoproj / argo-cd

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

History and Rollback ignores project-scoped repositories #12468

Open lgiedrius opened 1 year ago

lgiedrius commented 1 year ago

Checklist:

Describe the bug

History and rollback feature ignores project-scoped repositories. Requires additionally adding repositories to whitelist in the project itself

To Reproduce

  1. create project with no global repositories
  2. create project-scoped HELM repositories
  3. deploy application to the project
  4. Try to open "History and Rollback" and/or rollback to previous deployment

Expected behavior

Deployment parameters shown and possible to rollback

Screenshots

Successful syncing: image

Trying to see deployment revisions with parameters error and notification that "repository not allowed in project" image image

After adding to AppProject spec.sourceRepos: image

Attempt to rollback: image

Version

argocd: v2.6.1+3f143c9
  BuildDate: 2023-02-08T18:51:05Z
  GitCommit: 3f143c9307f99a61bf7049a2b1c7194699a7c21b
  GitTreeState: clean
  GoVersion: go1.18.10
  Compiler: gc
  Platform: linux/amd64

Logs

time="2023-02-15T12:10:00Z" level=info msg="received unary call /repository.RepositoryService/GetAppDetails" grpc.method=GetAppDetails grpc.request.content="%!v(PANIC=String method: reflect.Value.Bytes of non-byte slice)" grpc.service=repository.RepositoryService grpc.start_time="2023-02-15T12:10:00Z" span.kind=server system=grpc
time="2023-02-15T12:10:00Z" level=debug msg="<repository> has credentials"
time="2023-02-15T12:10:00Z" level=warning msg="finished unary call with code PermissionDenied" error="rpc error: code = PermissionDenied desc = repository '<repository>' not permitted in project '<project>'" grpc.code=PermissionDenied grpc.method=GetAppDetails grpc.service=repository.RepositoryService grpc.start_time="2023-02-15T12:10:00Z" grpc.time_ms=43.463 span.kind=server system=grpc
devthejo commented 1 year ago

same problem here, but setting sourceRepos not helping Argo CD v2.9.0+9cf0c69 Build Date 2023-11-06T04:43:50Z

devthejo commented 1 year ago

fixed by adding the repo to the list of repositories of the project