diff options
author | 2019-10-01 10:12:10 +0330 | |
---|---|---|
committer | 2019-10-01 07:42:10 +0100 | |
commit | 4ffbee299a751591ae98d7f07d3c721b819906c1 (patch) | |
tree | 8bcdddb3d71ba4a6b755f3352a44a7693e01fc65 /plugin | |
parent | dbd1c047cb973fc669fbe4e97dc12e7b3d3e6ed8 (diff) | |
download | coredns-4ffbee299a751591ae98d7f07d3c721b819906c1.tar.gz coredns-4ffbee299a751591ae98d7f07d3c721b819906c1.tar.zst coredns-4ffbee299a751591ae98d7f07d3c721b819906c1.zip |
Remove deprecated function calls flagged by staticcheck (#3333)
* Use session.NewSession instead of session.New
Signed-off-by: Erfan Besharat <erbesharat@gmail.com>
* Use grpc.DialContext instead of grpc.WithTimeout
Signed-off-by: Erfan Besharat <erbesharat@gmail.com>
* Pass non-nil context to context.WithTimeout
Signed-off-by: Erfan Besharat <erbesharat@gmail.com>
* Return the error directly in route53 setup
Co-Authored-By: Miek Gieben <miek@miek.nl>
Signed-off-by: Erfan Besharat <erbesharat@gmail.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/route53/setup.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugin/route53/setup.go b/plugin/route53/setup.go index 31169edaf..3b47fad59 100644 --- a/plugin/route53/setup.go +++ b/plugin/route53/setup.go @@ -120,8 +120,14 @@ func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Ro return plugin.Error("route53", c.Errf("unknown property '%s'", c.Val())) } } + + session, err := session.NewSession(&aws.Config{}) + if err != nil { + return plugin.Error("route53", err) + } + providers = append(providers, &credentials.EnvProvider{}, sharedProvider, &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(session.New(&aws.Config{})), + Client: ec2metadata.New(session), }) client := f(credentials.NewChainCredentials(providers)) ctx := context.Background() |