fix: Applicationset upsert for any namespaces (#15520)

* fix: Applicationset upsert for any namespaces

PR implements a small change to the argocd command adding the AppsetNamespace for the existing Appset check.

Signed-off-by: Harm Matthias Harms <matthias.harms@quis.de>

* Retrigger CI pipeline

Signed-off-by: Harm Matthias Harms <matthias.harms@quis.de>

* Retrigger CI pipeline

Signed-off-by: Harm Matthias Harms <matthias.harms@quis.de>

---------

Signed-off-by: Harm Matthias Harms <matthias.harms@quis.de>
This commit is contained in:
Harm Matthias Harms 2023-09-15 16:32:26 +02:00 committed by GitHub
parent 9b4589eaa8
commit 9f10a5fe0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,7 +147,7 @@ func NewApplicationSetCreateCommand(clientOpts *argocdclient.ClientOptions) *cob
defer argoio.Close(conn)
// Get app before creating to see if it is being updated or no change
existing, err := appIf.Get(ctx, &applicationset.ApplicationSetGetQuery{Name: appset.Name})
existing, err := appIf.Get(ctx, &applicationset.ApplicationSetGetQuery{Name: appset.Name, AppsetNamespace: appset.Namespace})
if grpc.UnwrapGRPCStatus(err).Code() != codes.NotFound {
errors.CheckError(err)
}