Commit 2bd77d08 authored by Anshul Sharma's avatar Anshul Sharma Committed by Miek Gieben

Fix multiple credentials in route53 (#2859)

parent f5fe9839
......@@ -35,6 +35,7 @@ func init() {
}
func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Route53API) error {
for c.Next() {
keyPairs := map[string]struct{}{}
keys := map[string][]string{}
......@@ -49,7 +50,7 @@ func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Ro
var fall fall.F
up := upstream.New()
for c.Next() {
args := c.RemainingArgs()
for i := 0; i < len(args); i++ {
......@@ -99,9 +100,7 @@ func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Ro
return c.Errf("unknown property '%s'", c.Val())
}
}
}
providers = append(providers, &credentials.EnvProvider{}, sharedProvider)
client := f(credentials.NewChainCredentials(providers))
ctx := context.Background()
h, err := New(ctx, client, keys, up)
......@@ -116,6 +115,6 @@ func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Ro
h.Next = next
return h
})
}
return nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment