Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ e2e: ## Run operator e2e tests


start-e2e:
ARGOCD_CLUSTER_CONFIG_NAMESPACES="argocd-e2e-cluster-config, argocd-test-impersonation-1-046, argocd-agent-principal-1-051" make run
ARGOCD_CLUSTER_CONFIG_NAMESPACES="argocd-e2e-cluster-config, argocd-test-impersonation-1-046, argocd-agent-principal-1-051, argocd-agent-agent-1-052" make run

all: test install run e2e ## UnitTest, Run the operator locally and execute e2e tests.

Expand Down
76 changes: 76 additions & 0 deletions api/v1alpha1/argocd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,9 @@ type ArgoCDAgentSpec struct {

// Principal defines configurations for the Principal component of Argo CD Agent.
Principal *PrincipalSpec `json:"principal,omitempty"`

// Agent defines configurations for the Agent component of Argo CD Agent.
Agent *AgentSpec `json:"agent,omitempty"`
}

type PrincipalSpec struct {
Expand Down Expand Up @@ -1149,6 +1152,79 @@ func (a *PrincipalSpec) IsEnabled() bool {
return a.Enabled != nil && *a.Enabled
}

type AgentSpec struct {

// Enabled is the flag to enable the Agent component during Argo CD installation. (optional, default `false`)
Enabled *bool `json:"enabled,omitempty"`

// Client defines the client options for the Agent component.
Client *AgentClientSpec `json:"client,omitempty"`

// TLS defines the TLS options for the Agent component.
TLS *AgentTLSSpec `json:"tls,omitempty"`

// Redis defines the Redis options for the Agent component.
Redis *AgentRedisSpec `json:"redis,omitempty"`
}

type AgentClientSpec struct {

// PrincipalServerAddress is the remote address of the principal server to connect to.
PrincipalServerAddress string `json:"principalServerAddress,omitempty"`

// PrincipalServerPort is the remote port of the principal server to connect to.
PrincipalServerPort string `json:"principalServerPort,omitempty"`

// Creds is the credential identifier for the agent authentication
Creds string `json:"creds,omitempty"`

// Mode is the operational mode for the agent (managed or autonomous)
Mode string `json:"mode,omitempty"`

// EnableWebSocket is the flag to enable WebSocket for event streaming
EnableWebSocket *bool `json:"enableWebSocket,omitempty"`

// EnableCompression is the flag to enable compression while sending data between Principal and Agent using gRPC
EnableCompression *bool `json:"enableCompression,omitempty"`

// LogLevel refers to the log level used by the Agent component.
LogLevel string `json:"logLevel,omitempty"`

// LogFormat refers to the log format used by the Agent component.
LogFormat string `json:"logFormat,omitempty"`

// KeepAliveInterval is the interval for keep-alive pings to the principal
KeepAliveInterval string `json:"keepAliveInterval,omitempty"`

// Image is the name of Argo CD Agent image
Image string `json:"image,omitempty"`

// Env lets you specify environment for agent pods
Env []corev1.EnvVar `json:"env,omitempty"`
}

type AgentTLSSpec struct {

// SecretName is the name of the secret containing the agent client TLS certificate
SecretName string `json:"secretName,omitempty"`

// RootCASecretName is the name of the secret containing the root CA certificate
RootCASecretName string `json:"rootCASecretName,omitempty"`

// Insecure is the flag to skip TLS certificate validation when connecting to the principal (insecure, for development only)
Insecure *bool `json:"insecure,omitempty"`
}

type AgentRedisSpec struct {

// ServerAddress is the address of the Redis server to be used by the PrincAgentipal component.
ServerAddress string `json:"serverAddress,omitempty"`
}

func (a *AgentSpec) IsEnabled() bool {
return a.Enabled != nil && *a.Enabled
}

// IsDeletionFinalizerPresent checks if the instance has deletion finalizer
func (argocd *ArgoCD) IsDeletionFinalizerPresent() bool {
for _, finalizer := range argocd.GetFinalizers() {
Expand Down
107 changes: 107 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 76 additions & 0 deletions api/v1beta1/argocd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,9 @@ type ArgoCDAgentSpec struct {

// Principal defines configurations for the Principal component of Argo CD Agent.
Principal *PrincipalSpec `json:"principal,omitempty"`

// Agent defines configurations for the Agent component of Argo CD Agent.
Agent *AgentSpec `json:"agent,omitempty"`
}

type PrincipalSpec struct {
Expand Down Expand Up @@ -1308,6 +1311,79 @@ func (a *PrincipalSpec) IsEnabled() bool {
return a.Enabled != nil && *a.Enabled
}

type AgentSpec struct {

// Enabled is the flag to enable the Agent component during Argo CD installation. (optional, default `false`)
Enabled *bool `json:"enabled,omitempty"`

// Client defines the client options for the Agent component.
Client *AgentClientSpec `json:"client,omitempty"`

// Redis defines the Redis options for the Agent component.
Redis *AgentRedisSpec `json:"redis,omitempty"`

// TLS defines the TLS options for the Agent component.
TLS *AgentTLSSpec `json:"tls,omitempty"`
}

type AgentClientSpec struct {

// PrincipalServerAddress is the remote address of the principal server to connect to.
PrincipalServerAddress string `json:"principalServerAddress,omitempty"`

// PrincipalServerPort is the remote port of the principal server to connect to.
PrincipalServerPort string `json:"principalServerPort,omitempty"`

// Creds is the credential identifier for the agent authentication
Creds string `json:"creds,omitempty"`

// Mode is the operational mode for the agent (managed or autonomous)
Mode string `json:"mode,omitempty"`

// EnableWebSocket is the flag to enable WebSocket for event streaming
EnableWebSocket *bool `json:"enableWebSocket,omitempty"`

// EnableCompression is the flag to enable compression while sending data between Principal and Agent using gRPC
EnableCompression *bool `json:"enableCompression,omitempty"`

// LogLevel refers to the log level used by the Agent component.
LogLevel string `json:"logLevel,omitempty"`

// LogFormat refers to the log format used by the Agent component.
LogFormat string `json:"logFormat,omitempty"`

// KeepAliveInterval is the interval for keep-alive pings to the principal
KeepAliveInterval string `json:"keepAliveInterval,omitempty"`

// Image is the name of Argo CD Agent image
Image string `json:"image,omitempty"`

// Env lets you specify environment for agent pods
Env []corev1.EnvVar `json:"env,omitempty"`
}

type AgentRedisSpec struct {

// ServerAddress is the address of the Redis server to be used by the PrincAgentipal component.
ServerAddress string `json:"serverAddress,omitempty"`
}

type AgentTLSSpec struct {

// SecretName is the name of the secret containing the agent client TLS certificate
SecretName string `json:"secretName,omitempty"`

// RootCASecretName is the name of the secret containing the root CA certificate
RootCASecretName string `json:"rootCASecretName,omitempty"`

// Insecure is the flag to skip TLS certificate validation when connecting to the principal (insecure, for development only)
Insecure *bool `json:"insecure,omitempty"`
}

func (a *AgentSpec) IsEnabled() bool {
return a.Enabled != nil && *a.Enabled
}

// IsDeletionFinalizerPresent checks if the instance has deletion finalizer
func (argocd *ArgoCD) IsDeletionFinalizerPresent() bool {
for _, finalizer := range argocd.GetFinalizers() {
Expand Down
Loading