mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
fix assume role when running in ECS. (#2876)
This fixes #2875 Signed-off-by: Boris Petersen <boris.petersen@idealo.de>
This commit is contained in:
parent
ce00b3862f
commit
855d7d1bda
1 changed files with 5 additions and 1 deletions
|
@ -204,7 +204,11 @@ func (cfg *Config) getAPICredentials() (*credentials, error) {
|
|||
}
|
||||
if ecsMetaURI := os.Getenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"); len(ecsMetaURI) > 0 {
|
||||
path := "http://169.254.170.2" + ecsMetaURI
|
||||
return getECSRoleCredentialsByPath(cfg.client, path)
|
||||
ac, err := getECSRoleCredentialsByPath(cfg.client, path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot obtain ECS role credentials: %w", err)
|
||||
}
|
||||
acNew = ac
|
||||
}
|
||||
|
||||
// we need instance credentials if dont have access keys
|
||||
|
|
Loading…
Reference in a new issue