Generated application is conflict unexpectedly using Cluster Generator of ApplicationSet.
In Argo CD, server is used as unique ID, and name is used as metadata (please see Additional notes in following).
But Cluster Generator use name as entry in generation loop, so we cannot use same name with Cluster Generator.
We provide Kubernetes as a Service, so some tenants create same name cluster. After that, ArgoCD sync and delete manifests to the cluster randomly, and then cluster is broken.
To Reproduce
Create same name cluster with different server.
Create ApplicationSet with Cluster Generator, using label for Application name
ApplicationSet Controller create Application for cluster-1
e.g. tenantA-mycluster-guestbook
And then, create new cluster cluster-2, and ApplicationSet Controller create Application for cluster-2.
e.g. tenantB-mycluster-guestbook
but currently, Cluster Generator only generate for cluster-2. because GenerateParams generate Applications by name.
Unexpectedly, delete Application for cluster-1 at deleteInCluster()
Expected behavior
Cluster generator should not delete existing Application with same name.
So I think Cluster generator shoud use server as entry in generation loop. I think this changes are not affected to others.
Checklist:
argocd version
.Describe the bug
Generated application is conflict unexpectedly using Cluster Generator of ApplicationSet.
In Argo CD,
server
is used as unique ID, andname
is used as metadata (please see Additional notes in following). But Cluster Generator usename
as entry in generation loop, so we cannot use samename
with Cluster Generator.We provide Kubernetes as a Service, so some tenants create same name cluster. After that, ArgoCD sync and delete manifests to the cluster randomly, and then cluster is broken.
To Reproduce
name
cluster with differentserver
.cluster-1
cluster-2
, and ApplicationSet Controller create Application forcluster-2
.cluster-2
. because GenerateParams generate Applications byname
.cluster-1
atdeleteInCluster()
Expected behavior
Cluster generator should not delete existing Application with same name. So I think Cluster generator shoud use
server
as entry in generation loop. I think this changes are not affected to others.Version
Logs
Additional notes
server
with samename
.server
with differentname
.Screenshots