mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
app/vmagent/remotewrite: do not shadow headers
global variable in getAuthConfig
This commit is contained in:
parent
0f6c17ed06
commit
1e6b0a1f54
1 changed files with 3 additions and 3 deletions
|
@ -172,9 +172,9 @@ func (c *client) MustStop() {
|
||||||
|
|
||||||
func getAuthConfig(argIdx int) (*promauth.Config, error) {
|
func getAuthConfig(argIdx int) (*promauth.Config, error) {
|
||||||
headersValue := headers.GetOptionalArg(argIdx)
|
headersValue := headers.GetOptionalArg(argIdx)
|
||||||
var headers []string
|
var hdrs []string
|
||||||
if headersValue != "" {
|
if headersValue != "" {
|
||||||
headers = strings.Split(headersValue, "^^")
|
hdrs = strings.Split(headersValue, "^^")
|
||||||
}
|
}
|
||||||
username := basicAuthUsername.GetOptionalArg(argIdx)
|
username := basicAuthUsername.GetOptionalArg(argIdx)
|
||||||
password := basicAuthPassword.GetOptionalArg(argIdx)
|
password := basicAuthPassword.GetOptionalArg(argIdx)
|
||||||
|
@ -212,7 +212,7 @@ func getAuthConfig(argIdx int) (*promauth.Config, error) {
|
||||||
InsecureSkipVerify: tlsInsecureSkipVerify.GetOptionalArg(argIdx),
|
InsecureSkipVerify: tlsInsecureSkipVerify.GetOptionalArg(argIdx),
|
||||||
}
|
}
|
||||||
|
|
||||||
authCfg, err := promauth.NewConfig(".", nil, basicAuthCfg, token, tokenFile, oauth2Cfg, tlsCfg, headers)
|
authCfg, err := promauth.NewConfig(".", nil, basicAuthCfg, token, tokenFile, oauth2Cfg, tlsCfg, hdrs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot populate OAuth2 config for remoteWrite idx: %d, err: %w", argIdx, err)
|
return nil, fmt.Errorf("cannot populate OAuth2 config for remoteWrite idx: %d, err: %w", argIdx, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue