We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0bf52f commit cef964cCopy full SHA for cef964c
cloud/linode/client/client.go
@@ -20,6 +20,7 @@ import (
20
const (
21
// DefaultClientTimeout is the default timeout for a client Linode API call
22
DefaultClientTimeout = 120 * time.Second
23
+ DefaultLinodeAPIURL = "https://api.linode.com"
24
)
25
26
type Client interface {
@@ -71,6 +72,9 @@ var _ Client = (*linodego.Client)(nil)
71
72
func New(token string, timeout time.Duration) (*linodego.Client, error) {
73
userAgent := fmt.Sprintf("linode-cloud-controller-manager %s", linodego.DefaultUserAgent)
74
apiURL := os.Getenv("LINODE_URL")
75
+ if apiURL == "" {
76
+ apiURL = DefaultLinodeAPIURL
77
+ }
78
79
linodeClient := linodego.NewClient(&http.Client{Timeout: timeout})
80
client, err := linodeClient.UseURL(apiURL)
0 commit comments