File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,16 +5,13 @@ import (
55 "encoding/json"
66 "fmt"
77 "net"
8- "net/http"
98 "os"
109 "path"
1110 "strconv"
1211 "strings"
1312 "sync"
1413 "time"
1514
16- "golang.org/x/oauth2"
17-
1815 "github.com/docker/go-plugins-helpers/volume"
1916 metadata "github.com/linode/go-metadata"
2017 "github.com/linode/linodego"
@@ -72,16 +69,13 @@ func (driver *linodeVolumeDriver) linodeAPI() (*linodego.Client, error) {
7269}
7370
7471func setupLinodeAPI (token string ) * linodego.Client {
75- tokenSource := oauth2 .StaticTokenSource (& oauth2.Token {AccessToken : token })
76- oauth2Client := & http.Client {
77- Transport : & oauth2.Transport {
78- Source : tokenSource ,
79- },
80- }
72+ api := linodego .NewClient (nil )
8173
82- api := linodego .NewClient (oauth2Client )
8374 ua := fmt .Sprintf ("docker-volume-linode/%s linodego/%s" , VERSION , linodego .Version )
8475 api .SetUserAgent (ua )
76+
77+ api .SetToken (token )
78+
8579 return & api
8680}
8781
You can’t perform that action at this time.
0 commit comments