argoproj-labs / argocd-operator

A Kubernetes operator for managing Argo CD clusters.
https://argocd-operator.readthedocs.io
Apache License 2.0
654 stars 760 forks source link

Cannot disconnect a repository with a wrong URL #1497

Closed mbrozzo closed 3 months ago

mbrozzo commented 3 months ago

Describe the bug I have connected a SSH repository with a wrong URL in ArgoCD (I left "git clone" in the URL) and now when I click "Disconnect" I only get this error in the UI: Unable to disconnect repository: repo 'git clone git@[ADDRESS].git' not found

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Settings'
  2. Click on 'Connect Repo'
  3. In the field "Repository URL" put a string with this format: "git clone git@[ADDRESS].git"
  4. Fill the other fields
  5. Connect the repo
  6. In the list of repositories, click the three dots on the right of the newly created repo
  7. Click "Disconnect"
  8. See the error

Expected behavior The repository is disconnected.

Screenshots image image

Additional context I am using the ArgoCD operator in OKD.

P.S.: I would appreciate if there was a workaround in the mean time.

svghadi commented 3 months ago

Hi @mbrozzo, you can manually delete the wrong repo from cluster by deleting the repo secret. Look for secrets with name repo<some number> in your ArgoCD instance namespace and inspect the url in them to identify the correct one to delete.

As for the bug, I could reproduce it but I believe it is a upstream Argo CD bug as operator doesn't handle repository object. Can you create a bug issue in argoproj/argo-cd upstream project?

mbrozzo commented 3 months ago

Hi @svghadi thank you very much, I was able to find and remove the secret, and the repo also disappeared from the UI. There is an open issue already on their GithHub, I will point out that, although I solved it, it is a problem on their side.

EDIT: should I close this issue?

svghadi commented 3 months ago

Yeah, we can close this and track the bug in Argo CD project.