4
4
"os"
5
5
"path/filepath"
6
6
7
- "github.com/spf13/cobra "
7
+ "github.com/argoproj/argo-cd/v2/cmd/util "
8
8
9
- _ "go.uber.org/automaxprocs "
9
+ "github.com/spf13/cobra "
10
10
11
11
appcontroller "github.com/argoproj/argo-cd/v2/cmd/argocd-application-controller/commands"
12
12
applicationset "github.com/argoproj/argo-cd/v2/cmd/argocd-applicationset-controller/commands"
@@ -31,9 +31,12 @@ func main() {
31
31
if val := os .Getenv (binaryNameEnv ); val != "" {
32
32
binaryName = val
33
33
}
34
+
35
+ isCLI := false
34
36
switch binaryName {
35
37
case "argocd" , "argocd-linux-amd64" , "argocd-darwin-amd64" , "argocd-windows-amd64.exe" :
36
38
command = cli .NewCommand ()
39
+ isCLI = true
37
40
case "argocd-server" :
38
41
command = apiserver .NewCommand ()
39
42
case "argocd-application-controller" :
@@ -42,19 +45,24 @@ func main() {
42
45
command = reposerver .NewCommand ()
43
46
case "argocd-cmp-server" :
44
47
command = cmpserver .NewCommand ()
48
+ isCLI = true
45
49
case "argocd-dex" :
46
50
command = dex .NewCommand ()
47
51
case "argocd-notifications" :
48
52
command = notification .NewCommand ()
49
53
case "argocd-git-ask-pass" :
50
54
command = gitaskpass .NewCommand ()
55
+ isCLI = true
51
56
case "argocd-applicationset-controller" :
52
57
command = applicationset .NewCommand ()
53
58
case "argocd-k8s-auth" :
54
59
command = k8sauth .NewCommand ()
60
+ isCLI = true
55
61
default :
56
62
command = cli .NewCommand ()
63
+ isCLI = true
57
64
}
65
+ util .SetAutoMaxProcs (isCLI )
58
66
59
67
if err := command .Execute (); err != nil {
60
68
os .Exit (1 )
0 commit comments