Skip to content

Conversation

@jparsai
Copy link
Collaborator

@jparsai jparsai commented Jan 13, 2026

This PR is to add ArgoCD Agent E2E tests in GitOps Operator. It has tests to verify Principal, Agent components in stand alone as well as connected mode. These tests are isolating principal, managed and autonomous agents in different namespaces to simulate multi cluster environment.

Here is how namespaces are used for principal/agent resource isolation to simulate hub and 2 spokes in same cluster.

Test Cluster (Has a Hub and two Spokes (Managed and Autonomous) simulated)
│
├─ 🏛️ Hub Cluster
│   ├─ Namespace: ns-hosting-principal
│   │   ├─ ArgoCD: argocd-hub (Principal enabled)
│   │   ├─ Deployment: argocd-hub-agent-principal
│   │   ├─ Service: argocd-hub-agent-principal (Type LoadBalancer)
│   │   ├─ Secrets: TLS, JWT, CA, Cluster registration secrets
│   │   └─ AppProject: agent-app-project ("Source of truth" for managed agent, delivered to agent by principal)
│   │
│   ├─ Namespace: managed-cluster-in-hub (Logical representation of managed cluster in hub)
│   │   └─ Application: app-managed ("Source of truth" for managed agent, delivered to agent by principal)
│   │
│   └─ Namespace: autonomous-cluster-in-hub (Logical representation of autonomous cluster in hub)
|       └─ Application: app-autonomous ("Source of truth" is autonomous agent, delivered to principal by agent)
│
├─ 🔵 Managed Spoke Cluster
│   ├─ Namespace: ns-hosting-managed-agent
│   │   ├─ ArgoCD: argocd-spoke (Agent enabled, Managed mode)
│   │   ├─ Deployment: argocd-spoke-agent-agent
│   │   ├─ Secrets: Client TLS, CA
|   |   └─ Application: app-managed ("Source of truth" is principal, but Reconciled and deployed in spoke by agent)
│   │
│   └─ Namespace: ns-hosting-app-in-managed-cluster
│       └─ Pod/Service/Route: spring-petclinic (Application resources deployed by agent in spoke)
│
└─ 🔵 Autonomous Spoke Cluster
    ├─ Namespace: ns-hosting-autonomous-agent
    │   ├─ ArgoCD: argocd-spoke (Agent enabled, Autonomous mode)
    │   ├─ Deployment: argocd-spoke-agent-agent
    │   ├─ Secrets: Client TLS, CA
    │   ├─ AppProject: agent-app-project ("Source of truth" is autonomous agent, delivered to principal by agent)
    │   └─ Application: app-autonomous ("Source of truth" is autonomous agent, delivered to principal by agent, Reconciled and deployed in spoke by agent)
    │
    └─ Namespace: ns-hosting-app-in-autonomous-cluster
        └─ Pod/Service/Route: spring-petclinic (Application resources deployed by agent in spoke)

/kind enhancement

Assisted by: Cursor

@openshift-ci openshift-ci bot added the kind/enhancement New feature or request label Jan 13, 2026
@openshift-ci openshift-ci bot requested review from keithchong and svghadi January 13, 2026 07:52
@openshift-ci
Copy link

openshift-ci bot commented Jan 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign svghadi for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Assisted by: Cursor

Signed-off-by: Jayendra Parsai <jparsai@redhat.com>
Copyright 2025.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to make the variable names used in 1-051_validate_argocd_agent_principal_test.go and 1-052_validate_argocd_agent_agent_test.go more consistent with the variable names in the same tests in argocd-operator?

The reason I ask is that generally we want to keep the tests (roughly) in sync between the two projects. We do this by manually comparing the test files using a tool like meld/beyondcompare/winmerge/etc. (In my case I used meld and beyondcompare).

  • The adhoc process for doing this is defined here.
  • Note: it's perfectly fine for the test files to be different in other ways, for example, fixture.SetEnvInOperatorSubscriptionOrDeployment() doesn't make sense in argocd-operator but DOES make sense in gitops-operator.
  • So we just want to make sure we do what we can to avoid differences between the files where it isn't needed (for example, variable names)

So, when I compare 1-051 files between argocd-operator and gitops-operator, (e.g. meld (path to 1-051 test in argocd-operator) (path to 1-0511 test in gitops-operator in PR)) I see that the files are very similar (which is good!) but the variables names between them are different.

For example, using beyondcompare (but any comparison tool will show the same):
Screenshot From 2026-01-14 11-40-17

This makes it more difficult to keep the tests in sync, as it means there are many diffs listed in the file comparison, even though the diff is only a variable name.

You can try this for yourself by comparing1-051 in your PR versus one in argocd-operator in the comparison tool of your choice.

WDYT? Presuming that makes sense, the change can be made in 1-051 and 1-052 in this PR. (AFAICT 1-053 didn't have the issue).

Comment on lines 126 to 133
ArgoCDDefaultRedisPort = 6379

// ArgoCDAgentAgentDefaultImageName is the default image name for the ArgoCD agent's agent component.
ArgoCDAgentAgentDefaultImageName = "quay.io/argoprojlabs/argocd-agent:v0.5.2"

// ArgoCDAgentPrincipalDefaultImageName is the default image name for the ArgoCD agent's principal component.
ArgoCDAgentPrincipalDefaultImageName = "quay.io/argoprojlabs/argocd-agent:v0.5.2"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than defining these values here, I would assume they can be read from the existing argocd-operator constants, for example, ArgoCDAgentAgentDefaultImageName in common/defaults.go?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it. My impression was that we need to keep them separated, but now I am using it from argocd operator.

@jparsai
Copy link
Collaborator Author

jparsai commented Jan 15, 2026

/test unit

Assisted by: Cursor

Signed-off-by: Jayendra Parsai <jparsai@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants