Skip to content

Commit

Permalink
fix logic to allow processor operation to be less than default value (#…
Browse files Browse the repository at this point in the history
…1146)

* fix logic to allow operation processors to be less than default value

---------

Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com>
  • Loading branch information
anandrkskd authored Jan 17, 2024
1 parent acee651 commit 816c053
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/argocd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (r *ReconcileArgoCD) getArgoServerURI(cr *argoproj.ArgoCD) string {
// getArgoServerOperationProcessors will return the numeric Operation Processors value for the ArgoCD Server.
func getArgoServerOperationProcessors(cr *argoproj.ArgoCD) int32 {
op := common.ArgoCDDefaultServerOperationProcessors
if cr.Spec.Controller.Processors.Operation > op {
if cr.Spec.Controller.Processors.Operation > 0 {
op = cr.Spec.Controller.Processors.Operation
}
return op
Expand Down
42 changes: 42 additions & 0 deletions controllers/argocd/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,48 @@ func TestGetArgoApplicationControllerCommand(t *testing.T) {
"text",
},
},
{
"configured operation processors to zero",
[]argoCDOpt{operationProcessors(0)},
[]string{
"argocd-application-controller",
"--operation-processors",
"10",
"--redis",
"argocd-redis.argocd.svc.cluster.local:6379",
"--repo-server",
"argocd-repo-server.argocd.svc.cluster.local:8081",
"--status-processors",
"20",
"--kubectl-parallelism-limit",
"10",
"--loglevel",
"info",
"--logformat",
"text",
},
},
{
"configured operation processors to be between zero and ten",
[]argoCDOpt{operationProcessors(5)},
[]string{
"argocd-application-controller",
"--operation-processors",
"5",
"--redis",
"argocd-redis.argocd.svc.cluster.local:6379",
"--repo-server",
"argocd-repo-server.argocd.svc.cluster.local:8081",
"--status-processors",
"20",
"--kubectl-parallelism-limit",
"10",
"--loglevel",
"info",
"--logformat",
"text",
},
},
{
"configured parallelism limit",
[]argoCDOpt{parallelismLimit(30)},
Expand Down

0 comments on commit 816c053

Please sign in to comment.