mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 19:50:30 +00:00
Update user agent for new ghalistener (#3138)
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/actions/actions-runner-controller/github/actions"
|
"github.com/actions/actions-runner-controller/github/actions"
|
||||||
"github.com/actions/actions-runner-controller/logging"
|
"github.com/actions/actions-runner-controller/logging"
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
|
"golang.org/x/net/http/httpproxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
@@ -101,7 +102,6 @@ func (c *Config) Logger() (logr.Logger, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config) ActionsClient(logger logr.Logger) (*actions.Client, error) {
|
func (c *Config) ActionsClient(logger logr.Logger) (*actions.Client, error) {
|
||||||
|
|
||||||
var creds actions.ActionsAuth
|
var creds actions.ActionsAuth
|
||||||
switch c.Token {
|
switch c.Token {
|
||||||
case "":
|
case "":
|
||||||
@@ -141,7 +141,14 @@ func (c *Config) ActionsClient(logger logr.Logger) (*actions.Client, error) {
|
|||||||
Version: build.Version,
|
Version: build.Version,
|
||||||
CommitSHA: build.CommitSHA,
|
CommitSHA: build.CommitSHA,
|
||||||
ScaleSetID: c.RunnerScaleSetId,
|
ScaleSetID: c.RunnerScaleSetId,
|
||||||
|
HasProxy: hasProxy(),
|
||||||
|
Subsystem: "ghalistener",
|
||||||
})
|
})
|
||||||
|
|
||||||
return client, nil
|
return client, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func hasProxy() bool {
|
||||||
|
proxyFunc := httpproxy.FromEnvironment().ProxyFunc()
|
||||||
|
return proxyFunc != nil
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user