Fix multiple credentials in route53 (#2859)
This commit is contained in:
parent
f5fe98395e
commit
2bd77d0823
1 changed files with 30 additions and 31 deletions
|
@ -35,6 +35,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Route53API) error {
|
func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Route53API) error {
|
||||||
|
for c.Next() {
|
||||||
keyPairs := map[string]struct{}{}
|
keyPairs := map[string]struct{}{}
|
||||||
keys := map[string][]string{}
|
keys := map[string][]string{}
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@ func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Ro
|
||||||
var fall fall.F
|
var fall fall.F
|
||||||
|
|
||||||
up := upstream.New()
|
up := upstream.New()
|
||||||
for c.Next() {
|
|
||||||
args := c.RemainingArgs()
|
args := c.RemainingArgs()
|
||||||
|
|
||||||
for i := 0; i < len(args); i++ {
|
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())
|
return c.Errf("unknown property '%s'", c.Val())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
providers = append(providers, &credentials.EnvProvider{}, sharedProvider)
|
providers = append(providers, &credentials.EnvProvider{}, sharedProvider)
|
||||||
|
|
||||||
client := f(credentials.NewChainCredentials(providers))
|
client := f(credentials.NewChainCredentials(providers))
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
h, err := New(ctx, client, keys, up)
|
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
|
h.Next = next
|
||||||
return h
|
return h
|
||||||
})
|
})
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue