diff --git a/cmd/simplesqsd/simplesqsd.go b/cmd/simplesqsd/simplesqsd.go index a22cd0f..73aa570 100644 --- a/cmd/simplesqsd/simplesqsd.go +++ b/cmd/simplesqsd/simplesqsd.go @@ -71,16 +71,16 @@ func main() { WithRegion(c.QueueRegion). WithHTTPClient(httpClient) + sqsSvc := sqs.New(awsSess, sqsConfig) + // To workaround a kube2iam issue, expire credentials every minute. go func() { for { - sqsConfig.Credentials.Expire() + sqsSvc.Config.Credentials.Expire() time.Sleep(time.Minute) } }() - sqsSvc := sqs.New(awsSess, sqsConfig) - wConf := supervisor.WorkerConfig{ QueueURL: c.QueueURL, QueueMaxMessages: c.QueueMaxMessages,