-
Notifications
You must be signed in to change notification settings - Fork 1
/
helper.go
53 lines (48 loc) · 935 Bytes
/
helper.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package gke
import (
"os/exec"
"sort"
"strings"
)
func GetGoogleZones() ([]string, error) {
var zones []string
out, err := exec.Command("gcloud", "compute", "zones", "list").Output()
if err != nil {
return nil, err
}
for _, item := range strings.Split(string(out), "\n") {
zone := strings.Split(item, " ")[0]
if strings.Contains(zone, "-") {
zones = append(zones, zone)
}
sort.Strings(zones)
}
return zones, nil
}
func GetGoogleMachineTypes() []string {
return []string{
"g1-small",
"n1-standard-1",
"n1-standard-2",
"n1-standard-4",
"n1-standard-8",
"n1-standard-16",
"n1-standard-32",
"n1-standard-64",
"n1-standard-96",
"n1-highmem-2",
"n1-highmem-4",
"n1-highmem-8",
"n1-highmem-16",
"n1-highmem-32",
"n1-highmem-64",
"n1-highmem-96",
"n1-highcpu-2",
"n1-highcpu-4",
"n1-highcpu-8",
"n1-highcpu-16",
"n1-highcpu-32",
"n1-highcpu-64",
"n1-highcpu-96",
}
}