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

Support same repository address but different projects #17897

Closed
yyzxw opened this issue Apr 19, 2024 · 2 comments · Fixed by #18290 or #18388
Closed

Support same repository address but different projects #17897

yyzxw opened this issue Apr 19, 2024 · 2 comments · Fixed by #18290 or #18388
Assignees
Labels
enhancement New feature or request

Comments

@yyzxw
Copy link
Contributor

yyzxw commented Apr 19, 2024

Summary

similar to #9581 , support same repository address in different projects.

Motivation

we used ArgoCD as the backend engine for GitOps, and in a multi-tenant scenario, we isolated different projects as tenants. So we want different projects to save the same url, because even with the same url, their credentials may be different. or just distinguish by project.

Proposal

  1. repo store
apiVersion: v1
kind: Secret
metadata:
  name: repo-83006512331
  labels:
    argocd.argoproj.io/secret-type: repository
data:
  name: repoName
  project: projectID
  type: git
  url: gitURL

why don't we use project and url as the key to create and query.

  1. repo connection state

as mentioned above, the same URL may use different credentials, so also need to get the connection status of the repository for each project and url as the cache key.

  1. repo credentials
apiVersion: v1
kind: Secret
metadata:
  name: argoproj-https-creds
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repo-creds
stringData:
  url: https://github.com/argoproj
  type: helm
  password: my-password
  username: my-username
  project: projectID     # add field

add project field. but there seems to be too much duplication with the repo definition. maybe it can be removed.

  1. how implement?
  • create
    use default project as default project if user not select project, is also for compatibility.
  • query
    query repo list need add project as query param
  • repo state
    repo cache key format:
    repo|repoURl|project|connection-state
    
    the cache needs to be rebuilt.

Or if there's any way to do that, please let me know. Thank you!

If this proposal is acceptable, I will submit a PR for it.

@blakepettersson
Copy link
Member

Hi, see #18290 - let me know what you think

@blakepettersson
Copy link
Member

Reopening since that was the spec that got merged, not the actual implementation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants