Skip to content

Commit

Permalink
Fix status operation value to allow less than 10 (argoproj-labs#1198)
Browse files Browse the repository at this point in the history
* fix logic to allow processor operation to be less than default

---------

Signed-off-by: Anand Kumar Singh <[email protected]>
  • Loading branch information
anandrkskd authored Feb 1, 2024
1 parent 8a1763f commit 0556c7d
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 @@ -318,7 +318,7 @@ func getArgoServerOperationProcessors(cr *argoproj.ArgoCD) int32 {
// getArgoServerStatusProcessors will return the numeric Status Processors value for the ArgoCD Server.
func getArgoServerStatusProcessors(cr *argoproj.ArgoCD) int32 {
sp := common.ArgoCDDefaultServerStatusProcessors
if cr.Spec.Controller.Processors.Status > sp {
if cr.Spec.Controller.Processors.Status > 0 {
sp = cr.Spec.Controller.Processors.Status
}
return sp
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 @@ -368,6 +368,48 @@ func TestGetArgoApplicationControllerCommand(t *testing.T) {
"text",
},
},
{
"configured status processors to zero",
[]argoCDOpt{controllerProcessors(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 status processors to be between zero and default",
[]argoCDOpt{controllerProcessors(10)},
[]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",
"10",
"--kubectl-parallelism-limit",
"10",
"--loglevel",
"info",
"--logformat",
"text",
},
},
{
"configured operation processors",
[]argoCDOpt{operationProcessors(15)},
Expand Down

0 comments on commit 0556c7d

Please sign in to comment.