Skip to content

Commit

Permalink
Merge pull request #2 from fterrag/kube2iam-workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
fterrag authored May 17, 2018
2 parents ca5f1c6 + bde6c18 commit e8e4f90
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/simplesqsd/simplesqsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"net/http"
"os"
"strconv"
"time"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
Expand Down Expand Up @@ -70,6 +71,14 @@ func main() {
WithRegion(c.QueueRegion).
WithHTTPClient(httpClient)

// To workaround a kube2iam issue, expire credentials every minute.
go func() {
for {
sqsConfig.Credentials.Expire()
time.Sleep(time.Minute)
}
}()

sqsSvc := sqs.New(awsSess, sqsConfig)

wConf := supervisor.WorkerConfig{
Expand Down

0 comments on commit e8e4f90

Please sign in to comment.