diff --git a/cmd/argo/commands/client/conn.go b/cmd/argo/commands/client/conn.go index 7b4750f7bf30..290206167613 100644 --- a/cmd/argo/commands/client/conn.go +++ b/cmd/argo/commands/client/conn.go @@ -2,12 +2,15 @@ package client import ( "context" + "fmt" "os" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" + restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + "github.com/argoproj/argo-workflows/v3" "github.com/argoproj/argo-workflows/v3/pkg/apiclient" "github.com/argoproj/argo-workflows/v3/util/kubeconfig" ) @@ -86,6 +89,8 @@ func GetAuthString() string { if err != nil { log.Fatal(err) } + version := argo.GetVersion() + restConfig = restclient.AddUserAgent(restConfig, fmt.Sprintf("argo-workflows/%s argo-cli", version.Version)) authString, err := kubeconfig.GetAuthString(restConfig, explicitPath) if err != nil { log.Fatal(err) diff --git a/cmd/argo/commands/server.go b/cmd/argo/commands/server.go index 1cc4fb193f0e..cf38b2f2e423 100644 --- a/cmd/argo/commands/server.go +++ b/cmd/argo/commands/server.go @@ -16,8 +16,10 @@ import ( "golang.org/x/net/context" "k8s.io/client-go/kubernetes" _ "k8s.io/client-go/plugin/pkg/client/auth" + restclient "k8s.io/client-go/rest" "k8s.io/utils/env" + "github.com/argoproj/argo-workflows/v3" "github.com/argoproj/argo-workflows/v3/cmd/argo/commands/client" wfclientset "github.com/argoproj/argo-workflows/v3/pkg/client/clientset/versioned" "github.com/argoproj/argo-workflows/v3/server/apiserver" @@ -59,6 +61,8 @@ See %s`, help.ArgoSever), if err != nil { return err } + version := argo.GetVersion() + config = restclient.AddUserAgent(config, fmt.Sprintf("argo-workflows/%s argo-server", version.Version)) config.Burst = 30 config.QPS = 20.0 diff --git a/cmd/argoexec/commands/root.go b/cmd/argoexec/commands/root.go index f0a98c491119..58646e940f41 100644 --- a/cmd/argoexec/commands/root.go +++ b/cmd/argoexec/commands/root.go @@ -79,8 +79,8 @@ func initExecutor() *executor.WorkflowExecutor { executorType := os.Getenv(common.EnvVarContainerRuntimeExecutor) log.WithFields(log.Fields{"version": version, "executorType": executorType}).Info("Starting Workflow Executor") config, err := clientConfig.ClientConfig() - config = restclient.AddUserAgent(config, fmt.Sprintf("argo-workflows/%s executor/%s", version.Version, executorType)) checkErr(err) + config = restclient.AddUserAgent(config, fmt.Sprintf("argo-workflows/%s argo-executor/%s", version.Version, executorType)) logs.AddK8SLogTransportWrapper(config) // lets log all request as we should typically do < 5 per pod, so this is will show up problems diff --git a/cmd/workflow-controller/main.go b/cmd/workflow-controller/main.go index 73e24e97afa8..313655009b6d 100644 --- a/cmd/workflow-controller/main.go +++ b/cmd/workflow-controller/main.go @@ -19,8 +19,10 @@ import ( // load authentication plugin for obtaining credentials from cloud providers. _ "k8s.io/client-go/plugin/pkg/client/auth" + restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + "github.com/argoproj/argo-workflows/v3" wfclientset "github.com/argoproj/argo-workflows/v3/pkg/client/clientset/versioned" cmdutil "github.com/argoproj/argo-workflows/v3/util/cmd" "github.com/argoproj/argo-workflows/v3/util/logs" @@ -71,6 +73,8 @@ func NewRootCommand() *cobra.Command { if err != nil { return err } + version := argo.GetVersion() + config = restclient.AddUserAgent(config, fmt.Sprintf("argo-workflows/%s argo-controller", version.Version)) config.Burst = burst config.QPS = qps