diff --git a/README.md b/README.md index 82a56f8d..2a9397fe 100644 --- a/README.md +++ b/README.md @@ -203,10 +203,6 @@ inletsctl create --provider scaleway \ The region is hard-coded to France / Paris 1. -## Example for GCE - -Follow the steps here to [configure your service account](https://github.com/inlets/inlets-operator#running-in-cluster-using-google-compute-engine-for-the-exit-node-using-helm) - ## Examples for `inletsctl kfwd` The `inletsctl kfwd` command can port-forward services from within your local Kubernetes cluster to your local network or computer. diff --git a/cmd/create.go b/cmd/create.go index c8187b32..ea99b093 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -4,23 +4,39 @@ package cmd import ( + "crypto/tls" "encoding/base64" "fmt" + "net/http" + "os" + "os/signal" "strconv" "strings" + "syscall" "time" + "gopkg.in/yaml.v2" + "github.com/inlets/inletsctl/pkg/env" "github.com/inlets/inletsctl/pkg/names" "github.com/inlets/inletsctl/pkg/provision" + execute "github.com/alexellis/go-execute/pkg/v1" + "github.com/hashicorp/go-retryablehttp" "github.com/pkg/errors" "github.com/sethvargo/go-password/password" "github.com/spf13/cobra" ) -const inletsControlPort = 8080 +var ( + pro bool + inletsControlPort = 8080 + delTunnel bool + tcpPorts string + inletsProLicenseKey string +) + const inletsProControlPort = 8123 func init() { @@ -41,8 +57,13 @@ func init() { createCmd.Flags().String("project-id", "", "Project ID (Packet.com, Google Compute Engine)") createCmd.Flags().StringP("remote-tcp", "c", "", `Remote host for inlets-pro to use for forwarding TCP connections`) + createCmd.Flags().String("tcp-ports", "80,443", "Comma-separated list of TCP ports to proxy (default '80,443')") createCmd.Flags().DurationP("poll", "n", time.Second*2, "poll every N seconds, use a higher value if you encounter rate-limiting") + + createCmd.Flags().BoolVar(&delTunnel, "rm", false, "Delete the exit node on pressing Control + c") + createCmd.Flags().StringP("upstream", "u", "", "The upstream server running locally") + createCmd.Flags().StringP("license", "l", "", "The license key for inlets-pro") } // clientCmd represents the client sub command. @@ -52,20 +73,41 @@ var createCmd = &cobra.Command{ Long: `Create an exit node on cloud infrastructure. The estimated cost of each VM along with what OS version and spec will be used is explained in the README. `, - Example: ` inletsctl create \ + Example: ` # To use inlets-OSS run + inletsctl create \ --provider [digitalocean|packet|ec2|scaleway|civo|gce] \ - --access-token-file $HOME/access-token \ - --region lon1 + --access-token-file $HOME/access-token + + + # To create a temporary tunnel with inlets-OSS run + inletsctl create --rm \ + --provider [digitalocean|packet|ec2|scaleway|civo|gce] \ + --access-token-file $HOME/access-token \ + --upstream http://127.0.0.1:3000 + + + # For inlets-pro, give the --remote-tcp flag + inletsctl create \ + --proider [digitalocean|packet|ec2|scaleway|civo|gce] \ + --access-token-file $HOME/access-token \ + --remote-tcp 192.168.0.100 \ + --tcp-ports=80,443,8080 + + + # To create a temporary tunnel with inlets-pro run + inletsctl create --rm \ + --provider [digitalocean|packet|ec2|scaleway|civo|gce] \ + --access-token-file $HOME/access-token \ + --remote-tcp 127.0.0.1:3000 + --tcp-ports=80,443,8080 + --license=$INLETS_LICENSE`, - # For inlets-pro, give the --remote-tcp flag - inletsctl create --remote-tcp 192.168.0.100`, RunE: runCreate, SilenceUsage: true, SilenceErrors: true, } func runCreate(cmd *cobra.Command, _ []string) error { - provider, err := cmd.Flags().GetString("provider") if err != nil { return errors.Wrap(err, "failed to get 'provider' value.") @@ -129,7 +171,6 @@ func runCreate(cmd *cobra.Command, _ []string) error { var organisationID string var projectID string if provider == "scaleway" || provider == "ec2" { - var secretKeyErr error secretKey, secretKeyErr = getFileOrString(cmd.Flags(), "secret-key-file", "secret-key", true) if secretKeyErr != nil { @@ -156,14 +197,34 @@ func runCreate(cmd *cobra.Command, _ []string) error { } remoteTCP, _ := cmd.Flags().GetString("remote-tcp") - var pro bool + upstream, _ := cmd.Flags().GetString("upstream") if len(remoteTCP) > 0 { pro = true + tcpPorts, _ = cmd.Flags().GetString("tcp-ports") + inletsProLicenseKey, _ = cmd.Flags().GetString("license") + } + + if delTunnel == true { + if len(remoteTCP) == 0 && len(upstream) == 0 { + return fmt.Errorf("either of --remote-tcp or --upstream must be specified") + } else if !checkIfInletsIsInstalled(pro) { + if pro { + return fmt.Errorf("inlets-pro is not installed.\nDownload with:\n\n$ sudo inletsctl download --pro") + } + return fmt.Errorf("inlets is not installed.\nDownload with:\n\n$ sudo inletsctl download") + } + } + + if pro { + inletsControlPort = inletsProControlPort } name := strings.Replace(names.GetRandomName(10), "_", "-", -1) userData := makeUserdata(inletsToken, inletsControlPort, remoteTCP) + if provider == "gce" { + userData = makeUserdataforContainerRuntime(inletsToken, inletsControlPort, remoteTCP) + } hostReq, err := createHost(provider, name, region, zone, projectID, userData, strconv.Itoa(inletsControlPort), pro) if err != nil { @@ -192,49 +253,53 @@ func runCreate(cmd *cobra.Command, _ []string) error { return err } - fmt.Printf("[%d/%d] Host: %s, status: %s\n", - i+1, max, hostStatus.ID, hostStatus.Status) - if hostStatus.Status == "active" { - if !pro { - fmt.Printf(`Inlets OSS exit-node summary: - IP: %s - Auth-token: %s - -Command: - export UPSTREAM=http://127.0.0.1:8000 - inlets client --remote "ws://%s:%d" \ - --token "%s" \ - --upstream $UPSTREAM - -To Delete: - inletsctl delete --provider %s --id "%s" -`, - hostStatus.IP, inletsToken, hostStatus.IP, inletsControlPort, inletsToken, provider, hostStatus.ID) + if delTunnel == true { + sig := make(chan os.Signal, 1) + done := make(chan bool, 1) + + signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM) + + go func() { + sigval := <-sig + fmt.Printf("\n%v\n", sigval) + done <- true + close(sig) + }() + + fmt.Printf("Your IP is: %s\n", hostStatus.IP) + + var err error = nil + if pro { + err = runInletsClient(pro, hostStatus.IP, inletsControlPort, remoteTCP, inletsToken, tcpPorts, inletsProLicenseKey) + } else { + err = runInletsClient(pro, hostStatus.IP, inletsControlPort, upstream, inletsToken, tcpPorts, "") + } + if err != nil { + return fmt.Errorf("Error running inlets: %v", err) + } + + <-done + close(done) + hostDelReq := provision.HostDeleteRequest{ + ID: hostStatus.ID, + IP: hostStatus.IP, + ProjectID: projectID, + Zone: zone, + } + fmt.Printf("Deleting host: %s with IP: %s from %s\n", hostStatus.ID, hostStatus.IP, provider) + err = provisioner.Delete(hostDelReq) + if err != nil { + return fmt.Errorf("error deleting the exitnode: %v", err) + } + fmt.Println("exiting") + return nil + } else { + printExample(pro, hostStatus, inletsToken, provider, inletsControlPort) return nil } - - fmt.Printf(`inlets-pro exit-node summary: - IP: %s - Auth-token: %s - -Command: - export TCP_PORTS="8000" - export LICENSE="" - inlets-pro client --connect "wss://%s:%d/connect" \ - --token "%s" \ - --license "$LICENSE" \ - --tcp-ports $TCP_PORTS - -To Delete: - inletsctl delete --provider %s --id "%s" -`, - hostStatus.IP, inletsToken, hostStatus.IP, inletsProControlPort, inletsToken, provider, hostStatus.ID) - - return nil } } - return err } @@ -302,7 +367,7 @@ func createHost(provider, name, region, zone, projectID, userData, inletsPort st } else if provider == "gce" { return &provision.BasicHost{ Name: name, - OS: "projects/debian-cloud/global/images/debian-9-stretch-v20191121", + OS: "projects/cos-cloud/global/images/cos-stable-80-12739-78-0", Plan: "f1-micro", Region: "", UserData: userData, @@ -312,6 +377,7 @@ func createHost(provider, name, region, zone, projectID, userData, inletsPort st "firewall-name": "inlets", "firewall-port": inletsPort, "pro": fmt.Sprint(pro), + "tmp": fmt.Sprint(&delTunnel), }, }, nil } else if provider == "ec2" { @@ -352,19 +418,225 @@ curl -sLO https://raw.githubusercontent.com/inlets/inlets/master/hack/inlets-ope } return `#!/bin/bash -export AUTHTOKEN="` + authToken + `" -export REMOTETCP="` + remoteTCP + `" -export IP=$(curl -sfSL https://ifconfig.co) - -curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.5.6/inlets-pro > /tmp/inlets-pro && \ - chmod +x /tmp/inlets-pro && \ - mv /tmp/inlets-pro /usr/local/bin/inlets-pro - -curl -sLO https://raw.githubusercontent.com/inlets/inlets/master/hack/inlets-pro.service && \ - mv inlets-pro.service /etc/systemd/system/inlets-pro.service && \ - echo "AUTHTOKEN=$AUTHTOKEN" >> /etc/default/inlets-pro && \ - echo "REMOTETCP=$REMOTETCP" >> /etc/default/inlets-pro && \ - echo "IP=$IP" >> /etc/default/inlets-pro && \ - systemctl start inlets-pro && \ - systemctl enable inlets-pro` + export AUTHTOKEN="` + authToken + `" + export REMOTETCP="` + remoteTCP + `" + export IP=$(curl -sfSL https://ifconfig.co) + + curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.4.3/inlets-pro > /tmp/inlets-pro && \ + chmod +x /tmp/inlets-pro && \ + mv /tmp/inlets-pro /usr/local/bin/inlets-pro + + curl -sLO https://raw.githubusercontent.com/inlets/inlets/master/hack/inlets-pro.service && \ + mv inlets-pro.service /etc/systemd/system/inlets-pro.service && \ + echo "AUTHTOKEN=$AUTHTOKEN" >> /etc/default/inlets-pro && \ + echo "REMOTETCP=$REMOTETCP" >> /etc/default/inlets-pro && \ + echo "IP=$IP" >> /etc/default/inlets-pro && \ + systemctl start inlets-pro && \ + systemctl enable inlets-pro` +} + +func makeUserdataforContainerRuntime(authToken string, inletsControlPort int, remoteTCP string) string { + type Privileged struct { + Privileged bool `yaml:"privileged"` + } + + type Container struct { + Name string `yaml:"name"` + Image string `yaml:"image"` + Args []string `yaml:"args"` + SecurityContext *Privileged `yaml:"securityContext"` + STDIN bool `yaml:"stdin"` + TTY bool `yaml:"tty"` + RestartPolicy string `yaml:"restartPolicy"` + } + + type Containers struct { + Containers []Container `yaml:"containers"` + } + + type inlets struct { + Spec *Containers `yaml:"spec"` + } + + inletsUserData := &inlets{} + + if len(remoteTCP) == 0 { + args := []string{"server", + fmt.Sprintf("--control-port=%d", inletsControlPort), + fmt.Sprintf("--token=%s", authToken)} + + inletsUserData = &inlets{ + Spec: &Containers{ + []Container{ + { + Name: "inlets", + Image: "inlets/inlets:2.6.4-16-gf3ad45d-amd64", + Args: args, + SecurityContext: &Privileged{ + Privileged: true, + }, + STDIN: false, + TTY: false, + RestartPolicy: "Always", + }, + }, + }, + } + + } else { + args := []string{"server", + "--auto-tls=true", + "--remote-tcp=127.0.0.1", + "--common-name=$(curl -sSLf https://ifconfig.co)", + fmt.Sprintf("--token=%s", authToken)} + + inletsUserData = &inlets{ + Spec: &Containers{ + []Container{ + { + Name: "inlets", + Image: "inlets/inlets-pro:0.5.6-amd64", + Args: args, + SecurityContext: &Privileged{ + Privileged: true, + }, + STDIN: false, + TTY: false, + RestartPolicy: "Always", + }, + }, + }, + } + } + + data, _ := yaml.Marshal(inletsUserData) + return string(data) +} + +func printExample(pro bool, hostStatus *provision.ProvisionedHost, inletsToken string, provider string, inletsControlPort int) { + if !pro { + fmt.Printf(`Inlets OSS exit-node summary: +IP: %s +Auth-token: %s + +Command: +export UPSTREAM=http://127.0.0.1:3000 +inlets client --remote "ws://%s:%d" \ +--token "%s" \ +--upstream $UPSTREAM + +To Delete: +inletsctl delete --provider %s --id "%s" +`, + hostStatus.IP, inletsToken, hostStatus.IP, inletsControlPort, inletsToken, provider, hostStatus.ID) + } else { + fmt.Printf(`inlets-pro exit-node summary: +IP: %s +Auth-token: %s + +Command: +export TCP_PORTS="8000" +export LICENSE="" +inlets-pro client --connect "wss://%s:%d/connect" \ +--token "%s" \ +--license "$LICENSE" \ +--tcp-ports $TCP_PORTS + +To Delete: +inletsctl delete --provider %s --id "%s" +`, + hostStatus.IP, inletsToken, hostStatus.IP, inletsControlPort, inletsToken, provider, hostStatus.ID) + } +} + +func checkIfInletsIsInstalled(usingPro bool) bool { + basePath := "/usr/local/bin/%s" + if usingPro { + basePath = fmt.Sprintf(basePath, "inlets-pro") + } else { + basePath = fmt.Sprintf(basePath, "inlets") + } + + if _, err := os.Stat(basePath); os.IsNotExist(err) { + return false + } + + return true +} + +func runInletsClient(pro bool, exitNodeIP string, inletsControlPort int, upstream string, authToken string, tcpPorts string, license string) error { + var err error + if !pro { + fmt.Printf("Starting 'inlets client' now, hit Control+c to delete the tunnel\n\n") + cmd := execute.ExecTask{ + Command: "inlets", + Args: []string{"client", "--remote", + fmt.Sprintf("ws://%s:%d", exitNodeIP, inletsControlPort), + "--token", authToken, "--upstream", upstream}, + StreamStdio: true, + } + _, err := cmd.Execute() + if err != nil { + return fmt.Errorf("Error running inlets: %v", err) + } + + } else { + timeout := 600 + retries := 10 + url := fmt.Sprintf("https://%s:%d/.well-known/ca.crt", exitNodeIP, inletsControlPort) + up, err := checkServiceUp(url, timeout, retries) + fmt.Printf("Starting 'inlets-pro client', hit Control+c to delete the tunnel\n\n") + if err != nil { + return fmt.Errorf("%v", err) + } + if up { + cmd := execute.ExecTask{ + Command: "inlets-pro", + Args: []string{"client", "--connect", + fmt.Sprintf("wss://%s:%d/connect", exitNodeIP, inletsControlPort), + "--token", authToken, "--tcp-ports", tcpPorts, "--license", license}, + StreamStdio: true, + } + _, err := cmd.Execute() + if err != nil { + return fmt.Errorf("Error running inlets-pro: %v", err) + } + } + } + + if err != nil && fmt.Sprintf("%s", err) != "signal: interrupt" { + return fmt.Errorf("%v", err) + } + + return nil +} + +func checkServiceUp(url string, timeout int, retries int) (bool, error) { + fmt.Println("checking if the inlets server is up...") + transport := &http.Transport{ + TLSHandshakeTimeout: time.Second * time.Duration(timeout), + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + } + httpClient := &http.Client{ + Transport: transport, + Timeout: time.Duration(time.Second * time.Duration(timeout)), + } + + client := retryablehttp.Client{ + HTTPClient: httpClient, + RetryWaitMax: time.Second * time.Duration(timeout), + RetryWaitMin: time.Second * time.Duration(1), + RetryMax: retries, + CheckRetry: retryablehttp.DefaultRetryPolicy, + Backoff: retryablehttp.DefaultBackoff, + } + res, err := client.Get(url) + if err != nil { + fmt.Printf("error with GET request: %v\n", err) + } + if err == nil && res != nil && res.StatusCode == http.StatusOK { + return true, nil + } + + return false, fmt.Errorf("used maximum number of retries, failed to resolve if the service is up") } diff --git a/cmd/usr b/cmd/usr new file mode 100644 index 00000000..4b470896 --- /dev/null +++ b/cmd/usr @@ -0,0 +1,4 @@ +spec: + containers: + - name: instance-1 + args:\n - server\n - '--remote-tcp=127.0.0.1'\n securityContext:\n privileged: true\n stdin: false\n tty: false\n restartPolicy: Always\n\n# This container declaration format is not public API and may change without notice. Please\n# use gcloud command-line tool or Google Cloud Console to run Containers on Google Compute Engine." \ No newline at end of file diff --git a/go.mod b/go.mod index dbbdf7ce..14352593 100644 --- a/go.mod +++ b/go.mod @@ -3,26 +3,26 @@ module github.com/inlets/inletsctl go 1.13 require ( - cloud.google.com/go v0.49.0 // indirect - github.com/alexellis/go-execute v0.0.0-20191029181357-d17947259f74 - github.com/aws/aws-sdk-go v1.26.8 - github.com/digitalocean/godo v1.27.0 - github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect + cloud.google.com/go v0.52.0 // indirect + github.com/alexellis/go-execute v0.0.0-20200124154445-8697e4e28c5e + github.com/aws/aws-sdk-go v1.28.13 + github.com/digitalocean/godo v1.30.0 + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/google/uuid v1.1.1 + github.com/hashicorp/go-retryablehttp v0.6.4 github.com/morikuni/aec v1.0.0 github.com/packethost/packngo v0.2.0 - github.com/pkg/errors v0.8.1 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.4 + github.com/pkg/errors v0.9.1 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5 github.com/sethvargo/go-password v0.1.3 github.com/spf13/cobra v0.0.5 github.com/spf13/pflag v1.0.5 - go.opencensus.io v0.22.2 // indirect - golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933 // indirect - golang.org/x/oauth2 v0.0.0-20191122200657-5d9234df094c - golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 // indirect - google.golang.org/api v0.14.0 - google.golang.org/appengine v1.6.5 // indirect - google.golang.org/genproto v0.0.0-20191115221424-83cc0476cb11 // indirect - google.golang.org/grpc v1.25.1 // indirect - gopkg.in/yaml.v2 v2.2.7 // indirect + go.opencensus.io v0.22.3 // indirect + golang.org/x/net v0.0.0-20200202094626-16171245cfb2 // indirect + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d + golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 // indirect + google.golang.org/api v0.17.0 + google.golang.org/genproto v0.0.0-20200207204624-4f3edf09f4f6 // indirect + google.golang.org/grpc v1.27.1 // indirect + gopkg.in/yaml.v2 v2.2.8 ) diff --git a/go.sum b/go.sum index 34e21259..baebb202 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.49.0 h1:CH+lkubJzcPYB1Ggupcq0+k8Ni2ILdG2lYjDIgavDBQ= -cloud.google.com/go v0.49.0/go.mod h1:hGvAdzcWNbyuxS3nWhD7H2cIJxjRRTRLQVB0bdputVY= +cloud.google.com/go v0.52.0 h1:GGslhk/BU052LPlnI1vpp3fcbUs+hQ3E+Doti/3/vF8= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -14,12 +14,15 @@ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiy dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/alexellis/go-execute v0.0.0-20191029181357-d17947259f74 h1:3NSYa7HnT2RgQxFn1dHw7GJDgk5v1XzuNE3b1IdJVwY= -github.com/alexellis/go-execute v0.0.0-20191029181357-d17947259f74/go.mod h1:zfRbgnPVxXCSpiKrg1CE72hNUWInqxExiaz2D9ppTts= +github.com/alexellis/go-execute v0.0.0-20200124154445-8697e4e28c5e h1:0cv4CUENL7e67/ZlNrvExWqa6oKH/9iv0KQn0/+hYaY= +github.com/alexellis/go-execute v0.0.0-20200124154445-8697e4e28c5e/go.mod h1:zfRbgnPVxXCSpiKrg1CE72hNUWInqxExiaz2D9ppTts= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aws/aws-sdk-go v1.26.8 h1:W+MPuCFLSO/itZkZ5GFOui0YC1j3lZ507/m5DFPtzE4= -github.com/aws/aws-sdk-go v1.26.8/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.28.13 h1:JyCQQ86yil3hg7MtWdNH8Pbcgx92qlUV2v22Km63Mf4= +github.com/aws/aws-sdk-go v1.28.13/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -28,19 +31,20 @@ github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwc github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/digitalocean/godo v1.27.0 h1:78iE9oVvTnAEqhMip2UHFvL01b8LJcydbNUpr0cAmN4= -github.com/digitalocean/godo v1.27.0/go.mod h1:iJnN9rVu6K5LioLxLimlq0uRI+y/eAQjROUmeU/r0hY= +github.com/digitalocean/godo v1.30.0 h1:4Zb+xBlKMXKg772eyQk6px3sk9RhWj/CR75tQ375A/U= +github.com/digitalocean/godo v1.30.0/go.mod h1:iJnN9rVu6K5LioLxLimlq0uRI+y/eAQjROUmeU/r0hY= github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE= -github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -48,30 +52,42 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-retryablehttp v0.6.4 h1:BbgctKO892xEyOXnGiaAwIoSq1QZ/SS4AhjoAh9DnfY= +github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -86,15 +102,15 @@ github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7P github.com/packethost/packngo v0.2.0 h1:mSlzOof8PsOWCy78sBMt/PwMJTEjjQ/rRvMixu4Nm6c= github.com/packethost/packngo v0.2.0/go.mod h1:RQHg5xR1F614BwJyepfMqrKN+32IH0i7yX+ey43rEeQ= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.4 h1:k0j49IgEf+5j0vwqP8StW5gjzVNwmP0+0hWx/z3FKSw= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.4/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5 h1:SA3bNpLHWnRScBXQoIkb9wMXQFRn0nrThe5vDhSN/0A= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.5/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8= github.com/sethvargo/go-password v0.1.3 h1:18KkbGDkw8SuzeohAbWqBLNSfRQblVwEHOLbPa0PvWM= github.com/sethvargo/go-password v0.1.3/go.mod h1:2tyaaoHK/AlXwh5WWQDYjqQbHcq4cjPj5qb/ciYvu/Q= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -117,17 +133,21 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -136,11 +156,12 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -151,19 +172,21 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933 h1:e6HwijUxhDe+hPNjZQQn9bA5PW3vNmnN64U2ZW759Lk= -golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191122200657-5d9234df094c h1:HjRaKPaiWks0f5tA6ELVF7ZfqSppfPwOEEAvsrKUTO4= -golang.org/x/oauth2 v0.0.0-20191122200657-5d9234df094c/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -174,8 +197,10 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 h1:ZBzSG/7F4eNKz2L3GE9o300RX0Az1Bw5HF7PDraD+qU= -golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -197,14 +222,19 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.14.0 h1:uMf5uLi4eQMRrMKhCplNik4U4H8Z6C1br3zOtAa/aDE= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0 h1:0q95w+VuFtv4PAx4PZVQdBMmYbaCHbnfKaEiDIcVyag= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -219,22 +249,24 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115221424-83cc0476cb11 h1:51D++eCgOHufw5VfDE9Uzqyyc+OyQIjb9hkYy9LN5Fk= -google.golang.org/genproto v0.0.0-20191115221424-83cc0476cb11/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200207204624-4f3edf09f4f6 h1:tirixpud1WdjE3/NrL9ar4ot0ADfwls8sOcIf1ivRDw= +google.golang.org/genproto v0.0.0-20200207204624-4f3edf09f4f6/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/provision/ec2.go b/pkg/provision/ec2.go index 3b30ffbb..7c62885f 100644 --- a/pkg/provision/ec2.go +++ b/pkg/provision/ec2.go @@ -2,10 +2,11 @@ package provision import ( "fmt" - "github.com/aws/aws-sdk-go/aws/credentials" "strconv" "strings" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" @@ -40,7 +41,7 @@ func (p *EC2Provisioner) Provision(host BasicHost) (*ProvisionedHost, error) { } pro := host.Additional["pro"] - groupID, name, err := p.creteEC2SecurityGroup(port, pro) + groupID, name, err := p.createEC2SecurityGroup(port, pro) if err != nil { return nil, err } @@ -230,7 +231,7 @@ func (p *EC2Provisioner) lookupID(request HostDeleteRequest) (string, error) { } // creteEC2SecurityGroup creates a security group for the exit-node -func (p *EC2Provisioner) creteEC2SecurityGroup(controlPort int, pro string) (*string, *string, error) { +func (p *EC2Provisioner) createEC2SecurityGroup(controlPort int, pro string) (*string, *string, error) { ports := []int{80, 443, controlPort} proPorts := []int{1024, 65535} groupName := "inlets-" + uuid.New().String() diff --git a/pkg/provision/gce.go b/pkg/provision/gce.go index 30853ae3..4769cfe1 100644 --- a/pkg/provision/gce.go +++ b/pkg/provision/gce.go @@ -36,6 +36,11 @@ func (p *GCEProvisioner) Provision(host BasicHost) (*ProvisionedHost, error) { // instance auto restart on failure autoRestart := true + loggingEnabled := fmt.Sprint(true) + + if host.Additional["pro"] == "true" && host.Additional["tmp"] == "true" { + host.Plan = "e2-micro" + } instance := &compute.Instance{ Name: host.Name, @@ -53,7 +58,7 @@ func (p *GCEProvisioner) Provision(host BasicHost) (*ProvisionedHost, error) { InitializeParams: &compute.AttachedDiskInitializeParams{ Description: "Boot Disk for the exit-node created by inlets-operator", DiskName: host.Name, - DiskSizeGb: 10, + DiskSizeGb: 15, SourceImage: host.OS, }, }, @@ -61,13 +66,18 @@ func (p *GCEProvisioner) Provision(host BasicHost) (*ProvisionedHost, error) { Metadata: &compute.Metadata{ Items: []*compute.MetadataItems{ { - Key: "startup-script", + Key: "gce-container-declaration", Value: &host.UserData, }, + { + Key: "google-logging-enabled", + Value: &loggingEnabled, + }, }, }, Labels: map[string]string{ - "inlets": "exit-node", + "inlets": "exit-node", + "container-vm": "cos-stable-80-12739-78-0", }, Tags: &compute.Tags{ Items: []string{ diff --git a/pkg/provision/gce_test.go b/pkg/provision/gce_test.go index 295a7e92..fdd1089a 100644 --- a/pkg/provision/gce_test.go +++ b/pkg/provision/gce_test.go @@ -7,7 +7,7 @@ func TestCustomGCEIDConstAndDest(t *testing.T) { inputZone := "us-central1-a" inputProjectID := "playground" - customID := constructCustomGCEID(inputInstanceName, inputZone, inputProjectID) + customID := toGCEID(inputInstanceName, inputZone, inputProjectID) outputInstanceName, outputZone, outputProjectID, err := getGCEFieldsFromID(customID) if err != nil {