From f26452dbebedaaff0261fb1221e891bd25eb7df7 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 5 Aug 2019 13:05:07 -0400 Subject: [PATCH] avoid a panic on failed creds polling (#7257) Backport for issue #7238 --- command/agent/auth/alicloud/alicloud.go | 2 +- command/agent/auth/aws/aws.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/command/agent/auth/alicloud/alicloud.go b/command/agent/auth/alicloud/alicloud.go index 680a1ddbabff..dbccdd57c396 100644 --- a/command/agent/auth/alicloud/alicloud.go +++ b/command/agent/auth/alicloud/alicloud.go @@ -207,7 +207,7 @@ func (a *alicloudMethod) pollForCreds(credProvider providers.Provider, frequency return case <-ticker.C: if err := a.checkCreds(credProvider); err != nil { - a.logger.Warn("unable to retrieve current creds, retaining last creds", err) + a.logger.Warn("unable to retrieve current creds, retaining last creds", "error", err) } } } diff --git a/command/agent/auth/aws/aws.go b/command/agent/auth/aws/aws.go index d3ea6007202d..f0a063541172 100644 --- a/command/agent/auth/aws/aws.go +++ b/command/agent/auth/aws/aws.go @@ -279,7 +279,7 @@ func (a *awsMethod) pollForCreds(accessKey, secretKey, sessionToken string, freq return case <-ticker.C: if err := a.checkCreds(accessKey, secretKey, sessionToken); err != nil { - a.logger.Warn("unable to retrieve current creds, retaining last creds", err) + a.logger.Warn("unable to retrieve current creds, retaining last creds", "error", err) } } }