From c2b2be0d5a6566c56057e0fc83c0c53eda665c4c Mon Sep 17 00:00:00 2001 From: Arman Jindal Date: Mon, 4 Jul 2022 16:31:10 +0200 Subject: [PATCH 1/7] [#3360] Bug with external Go dependency build --- cli/pkg/cmd/create/create.go | 2 +- cli/pkg/providers/aws/aws.go | 2 ++ cli/pkg/workspace/init.go | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/cli/pkg/cmd/create/create.go b/cli/pkg/cmd/create/create.go index acb92b7394..77c76c9a69 100644 --- a/cli/pkg/cmd/create/create.go +++ b/cli/pkg/cmd/create/create.go @@ -65,7 +65,7 @@ func create(cmd *cobra.Command, args []string) { overrides.Version = version overrides.Namespace = namespace overrides.TrackingDisabled = disableTracking - dir, err := workspace.Create(workspacePath, overrides) + dir, err := workspace.Create(workspacePath, overrides, providerName) if err != nil { console.Exit("could not initialize Airy workspace directory", err) } diff --git a/cli/pkg/providers/aws/aws.go b/cli/pkg/providers/aws/aws.go index 2feec6256a..a572ca70d1 100644 --- a/cli/pkg/providers/aws/aws.go +++ b/cli/pkg/providers/aws/aws.go @@ -62,6 +62,8 @@ type KubeConfig struct { } func (p *provider) Provision(providerConfig map[string]string, dir workspace.ConfigDir) (kube.KubeCtx, error) { + fmt.Fprintf(p.w, "Hello... is it me your looking for???") + console.Exit("Arman :)") cfg, err := config.LoadDefaultConfig(context.TODO()) if err != nil { console.Exit(err) diff --git a/cli/pkg/workspace/init.go b/cli/pkg/workspace/init.go index e6751f1345..27f94e09f0 100644 --- a/cli/pkg/workspace/init.go +++ b/cli/pkg/workspace/init.go @@ -5,7 +5,7 @@ import ( "fmt" "os" "path/filepath" - + getter "github.com/hashicorp/go-getter" "github.com/spf13/viper" ) @@ -47,7 +47,7 @@ func getConfigPath(path string) string { return path } -func Create(path string, data template.Variables) (ConfigDir, error) { +func Create(path string, data template.Variables, providerName string) (ConfigDir, error) { path = getConfigPath(path) if _, err := os.Stat(path); os.IsNotExist(err) { err = os.MkdirAll(path, 0755) @@ -66,5 +66,17 @@ func Create(path string, data template.Variables) (ConfigDir, error) { // Init viper config err := viper.WriteConfigAs(filepath.Join(path, cliConfigFileName)) + if providerName == "aws"{ + remoteUrl := "github.com/airyhq/airy/infrastructure/terraform/install" + dst := path + "/terraform" + var gitGetter = &getter.Client{ + Src: remoteUrl, + Dst: dst, + Dir: true, + } + + if err := gitGetter.Get(); err != nil { + fmt.Printf("err %v", err) + } return ConfigDir{Path: path}, err } From ca1d139edbf4657df0d64aea485a20a9481d8d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pr=C3=B6schel?= Date: Tue, 5 Jul 2022 16:17:13 +0200 Subject: [PATCH 2/7] Also add disable proto globally file to this PR and fix gazelle import order --- cli/go.mod | 28 ++++++++++- cli/go.sum | 83 +++++++++++++++++++++++++++++++++ cli/pkg/workspace/BUILD | 1 + cli/pkg/workspace/init.go | 12 +++-- go.mod | 17 ++++++- go.sum | 20 ++++++++ go_repositories.bzl | 98 +++++++++++++++++++++++++++++++++------ tools/update-deps/go.mod | 2 +- tools/update-deps/go.sum | 2 + 9 files changed, 240 insertions(+), 23 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index fcf558418d..be34d12766 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -28,8 +28,10 @@ require ( ) require ( - cloud.google.com/go v0.100.2 // indirect - cloud.google.com/go/compute v1.6.1 // indirect + cloud.google.com/go v0.102.0 // indirect + cloud.google.com/go/compute v1.7.0 // indirect + cloud.google.com/go/iam v0.3.0 // indirect + cloud.google.com/go/storage v1.22.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect @@ -44,6 +46,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.11.5 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.16.6 // indirect github.com/aws/smithy-go v1.11.2 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful v2.15.0+incompatible // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect @@ -52,10 +55,16 @@ require ( github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/swag v0.21.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect + github.com/googleapis/gax-go/v2 v2.4.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-getter v1.6.2 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-version v1.1.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.13 // indirect @@ -63,10 +72,12 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.11.2 // indirect github.com/kr/text v0.2.0 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -81,6 +92,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.3.0 // indirect + github.com/ulikunitz/xz v0.5.8 // indirect github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect golang.org/x/net v0.0.0-20220630215102-69896b714898 // indirect @@ -89,7 +101,19 @@ require ( golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect + go.opencensus.io v0.23.0 // indirect + golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 // indirect + golang.org/x/net v0.0.0-20220630215102-69896b714898 // indirect + golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 // indirect + golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect + golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect + golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect + google.golang.org/api v0.86.0 // indirect google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f // indirect + google.golang.org/grpc v1.47.0 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.4 // indirect diff --git a/cli/go.sum b/cli/go.sum index 14e1b0d00d..766f5e9bf4 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -32,6 +32,7 @@ cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Ud cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2 h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -44,9 +45,12 @@ cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6m cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1 h1:2sMmt8prCn7DPaG4Pmh0N3Inmc8cT8ae5k1M6VJ9Wqc= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/iam v0.3.0 h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -56,7 +60,9 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0 h1:6RRlFMv1omScs6iq2hfE3IvgE+l6RfJPampq8UZc5TU= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= @@ -110,6 +116,7 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.37.29 h1:OlePDQg2idesIZKPy8egpN51RIF3DHhtREnvgNpTZhE= github.com/aws/aws-sdk-go v1.37.29/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.21 h1:xZBdJmgkTQuIrbq5jSi5gyUwyz4eRTvjmLoT+c+Ao/A= @@ -166,12 +173,15 @@ github.com/aws/smithy-go v1.11.2 h1:eG/N+CcUMAvsdffgMvjMKwfyDzIkjM6pfxMJ8Mzc6mE= github.com/aws/smithy-go v1.11.2/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= 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= @@ -183,6 +193,7 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -216,6 +227,7 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -271,6 +283,7 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/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/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/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= @@ -320,6 +333,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -350,12 +364,18 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0 h1:nRJtk3y8Fm770D42QV6T90ZnvFZyk7agSo3Q+Z9p3WI= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -369,14 +389,22 @@ github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBt github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-getter v1.6.2 h1:7jX7xcB+uVCliddZgeKyNxv0xoT7qL5KDtH7rU4IqIk= +github.com/hashicorp/go-getter v1.6.2/go.mod h1:IZCrswsZPeWv9IkVnLElzRU/gz/QPi6pZHn4tv6vbwA= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 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= @@ -398,6 +426,7 @@ github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= 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-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= @@ -417,6 +446,8 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -442,6 +473,8 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -452,6 +485,7 @@ github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HK github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -583,6 +617,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/txn2/txeh v1.3.0 h1:vnbv63htVMZCaQgLqVBxKvj2+HHHFUzNW7I183zjg3E= github.com/txn2/txeh v1.3.0/go.mod h1:O7M6gUTPeMF+vsa4c4Ipx3JDkOYrruB1Wry8QRsMcw8= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= @@ -602,6 +638,7 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -712,8 +749,14 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220524220425-1d687d428aca h1:xTaFYiPROfpPhqrfTIDXj0ri1SpfueYT951s4bAuDO8= golang.org/x/net v0.0.0-20220524220425-1d687d428aca/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220630215102-69896b714898 h1:K7wO6V1IrczY9QOQ2WkVpw4JQSwCd52UsxVEirZUfiw= +golang.org/x/net v0.0.0-20220630215102-69896b714898/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 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-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -736,6 +779,11 @@ golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 h1:zwrSfklXn0gxyLRX/aR+q6cgHbV/ItVyzbPlbA+dkAw= golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 h1:VnGaRqoLmqZH/3TMLJwYCEWkR4j1nuIU1U9TvbqsDUw= +golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= 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= @@ -747,6 +795,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -817,8 +866,13 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 h1:EH1Deb8WZJ0xc0WK//leUHXcX9aLE5SymusoTmMZye8= @@ -906,7 +960,11 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= 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= @@ -942,7 +1000,13 @@ google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQ google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0 h1:0AYh/ae6l9TDUvIQrDw5QRpM100P6oHgD+o3dYHMzJg= google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.86.0 h1:ZAnyOHQFIuWso1BodVfSaRyffD74T9ERGFa3k1fNk/U= +google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= 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= @@ -994,6 +1058,7 @@ google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -1026,7 +1091,16 @@ google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2I google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3 h1:SeX3QUcBj3fciwnfPT9kt5gBhFy/FCZtYZ+I/RB8agc= google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f h1:hJ/Y5SqPXbarffmAsApliUlcvMU+wScNGfyop4bZm8o= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= 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= @@ -1054,7 +1128,11 @@ google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1077,6 +1155,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -1114,14 +1193,18 @@ k8s.io/api v0.19.0 h1:XyrFIJqTYZJ2DU7FBE/bSPz7b1HvbVBuBf07oeo6eTc= k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= k8s.io/api v0.24.0 h1:J0hann2hfxWr1hinZIDefw7Q96wmCBx6SSB8IY0MdDg= k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= +k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= k8s.io/apimachinery v0.19.0 h1:gjKnAda/HZp5k4xQYjL0K/Yb66IvNqjthCb03QlKpaQ= k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/apimachinery v0.24.0 h1:ydFCyC/DjCvFCHK5OPMKBlxayQytB8pxy8YQInd5UyQ= k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/client-go v0.19.0 h1:1+0E0zfWFIWeyRhQYWzimJOyAk2UT7TiARaLNwJCf7k= k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU= k8s.io/client-go v0.24.0 h1:lbE4aB1gTHvYFSwm6eD3OF14NhFDKCejlnsGYlSJe5U= k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= +k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= +k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= diff --git a/cli/pkg/workspace/BUILD b/cli/pkg/workspace/BUILD index d090212822..bb2e85a923 100644 --- a/cli/pkg/workspace/BUILD +++ b/cli/pkg/workspace/BUILD @@ -11,6 +11,7 @@ go_library( deps = [ "//cli/pkg/workspace/template", "//lib/go/config", + "@com_github_hashicorp_go_getter//:go-getter", "@com_github_spf13_viper//:viper", "@in_gopkg_yaml_v2//:yaml_v2", ], diff --git a/cli/pkg/workspace/init.go b/cli/pkg/workspace/init.go index 27f94e09f0..5caecdd28c 100644 --- a/cli/pkg/workspace/init.go +++ b/cli/pkg/workspace/init.go @@ -3,10 +3,10 @@ package workspace import ( "cli/pkg/workspace/template" "fmt" - "os" - "path/filepath" getter "github.com/hashicorp/go-getter" "github.com/spf13/viper" + "os" + "path/filepath" ) func Init(path string) (ConfigDir, error) { @@ -66,7 +66,7 @@ func Create(path string, data template.Variables, providerName string) (ConfigDi // Init viper config err := viper.WriteConfigAs(filepath.Join(path, cliConfigFileName)) - if providerName == "aws"{ + if providerName == "aws" { remoteUrl := "github.com/airyhq/airy/infrastructure/terraform/install" dst := path + "/terraform" var gitGetter = &getter.Client{ @@ -74,9 +74,13 @@ func Create(path string, data template.Variables, providerName string) (ConfigDi Dst: dst, Dir: true, } - + if err := gitGetter.Get(); err != nil { fmt.Printf("err %v", err) } + return ConfigDir{Path: path}, err + } + + // TODO return ConfigDir{Path: path}, err } diff --git a/go.mod b/go.mod index 799092b576..e316d56400 100644 --- a/go.mod +++ b/go.mod @@ -36,6 +36,8 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/BurntSushi/toml v1.1.0 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect + cloud.google.com/go/iam v0.3.0 // indirect + cloud.google.com/go/storage v1.22.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/Masterminds/semver/v3 v3.1.1 // indirect @@ -59,6 +61,7 @@ require ( github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect github.com/containerd/containerd v1.6.6 // indirect github.com/cyphar/filepath-securejoin v0.2.3 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/cli v20.10.17+incompatible // indirect github.com/docker/distribution v2.8.1+incompatible // indirect @@ -82,6 +85,8 @@ require ( github.com/go-openapi/swag v0.21.1 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt v3.2.2+incompatible + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/gnostic v0.6.9 // indirect @@ -92,11 +97,17 @@ require ( github.com/googleapis/gnostic v0.5.5 // indirect github.com/gosuri/uitable v0.0.4 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect + github.com/googleapis/gax-go/v2 v2.4.0 // indirect + github.com/gorilla/mux v1.8.0 + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-getter v1.6.2 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-version v1.1.0 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/iancoleman/strcase v0.2.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.12 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmoiron/sqlx v1.3.5 // indirect @@ -168,6 +179,10 @@ require ( golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20220630174209-ad1d48641aa7 // indirect + github.com/ulikunitz/xz v0.5.8 // indirect + github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect + go.opencensus.io v0.23.0 // indirect + google.golang.org/api v0.86.0 // indirect google.golang.org/grpc v1.47.0 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/gorp.v1 v1.7.2 // indirect diff --git a/go.sum b/go.sum index 9e1b56831e..ef450e4cc0 100644 --- a/go.sum +++ b/go.sum @@ -218,6 +218,7 @@ github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:o github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.34.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.37.29 h1:OlePDQg2idesIZKPy8egpN51RIF3DHhtREnvgNpTZhE= github.com/aws/aws-sdk-go v1.37.29/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.21/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= @@ -267,6 +268,7 @@ github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= @@ -302,6 +304,7 @@ github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1 github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= @@ -794,6 +797,7 @@ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= 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= @@ -856,6 +860,7 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-getter v1.6.2/go.mod h1:IZCrswsZPeWv9IkVnLElzRU/gz/QPi6pZHn4tv6vbwA= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -870,6 +875,7 @@ github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= @@ -879,6 +885,7 @@ github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1 github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -980,6 +987,7 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -1066,6 +1074,7 @@ github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vq github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= @@ -1452,6 +1461,7 @@ github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1 github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= @@ -1708,6 +1718,7 @@ golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220524220425-1d687d428aca h1:xTaFYiPROfpPhqrfTIDXj0ri1SpfueYT951s4bAuDO8= golang.org/x/net v0.0.0-20220524220425-1d687d428aca/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220630215102-69896b714898/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 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= @@ -1734,6 +1745,7 @@ golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 h1:zwrSfklXn0gxyLRX/aR+q6cgHbV/ItVyzbPlbA+dkAw= golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= 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= @@ -1883,6 +1895,11 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbuf golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -2047,6 +2064,7 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= 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= @@ -2154,6 +2172,7 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220630174209-ad1d48641aa7/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= 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.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -2223,6 +2242,7 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= diff --git a/go_repositories.bzl b/go_repositories.bzl index e3a7d9c180..5f9cb601f8 100644 --- a/go_repositories.bzl +++ b/go_repositories.bzl @@ -309,6 +309,11 @@ def go_repositories(): importpath = "github.com/bshuster-repo/logrus-logstash-hook", sum = "h1:e+C0SB5R1pu//O4MQ3f9cFuPGoOVeF2fE4Og9otCc70=", version = "v1.0.0", + name = "com_github_bgentry_go_netrc", + build_file_proto_mode = "disable_global", + importpath = "github.com/bgentry/go-netrc", + sum = "h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=", + version = "v0.0.0-20140422174119-9fd32a8b3d3d", ) go_repository( @@ -398,6 +403,13 @@ def go_repositories(): sum = "h1:7aWHqerlJ41y6FOsEUvknqgXnGmJyJSbjhAWq5pO4F8=", version = "v0.0.0-20160711120539-c6fed771bfd5", ) + go_repository( + name = "com_github_cheggaaa_pb", + build_file_proto_mode = "disable_global", + importpath = "github.com/cheggaaa/pb", + sum = "h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc=", + version = "v1.0.27", + ) go_repository( name = "com_github_chzyer_logex", @@ -703,18 +715,18 @@ def go_repositories(): version = "v1.1.1", ) go_repository( - name = "com_github_daviddengcn_go_colortext", + name = "com_github_docopt_docopt_go", build_file_proto_mode = "disable_global", - importpath = "github.com/daviddengcn/go-colortext", - sum = "h1:uVsMphB1eRx7xB1njzL3fuMdWRN8HtVzoUOItHMwv5c=", - version = "v0.0.0-20160507010035-511bcaf42ccd", + importpath = "github.com/docopt/docopt-go", + sum = "h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=", + version = "v0.0.0-20180111231733-ee0de3bc6815", ) go_repository( - name = "com_github_denisenkom_go_mssqldb", + name = "com_github_elazarl_goproxy", build_file_proto_mode = "disable_global", - importpath = "github.com/denisenkom/go-mssqldb", - sum = "h1:RSohk2RsiZqLZ0zCjtfn3S4Gp4exhpBWHyQ7D0yGjAk=", - version = "v0.9.0", + importpath = "github.com/elazarl/goproxy", + sum = "h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=", + version = "v0.0.0-20180725130230-947c36da3153", ) go_repository( @@ -840,6 +852,20 @@ def go_repositories(): version = "v3.8.0", ) + go_repository( + name = "com_github_envoyproxy_go_control_plane", + build_file_proto_mode = "disable_global", + importpath = "github.com/envoyproxy/go-control-plane", + sum = "h1:xvqufLtNVwAhN8NMyWklVgxnWohi+wtMGQMhtxexlm0=", + version = "v0.10.2-0.20220325020618-49ff273808a1", + ) + go_repository( + name = "com_github_emicklei_go_restful", + build_file_proto_mode = "disable_global", + importpath = "github.com/emicklei/go-restful", + sum = "h1:8KpYO/Xl/ZudZs5RNOEhWMBY4hmzlZhhRd9cu+jrZP4=", + version = "v2.15.0+incompatible", + ) go_repository( name = "com_github_envoyproxy_go_control_plane", build_file_proto_mode = "disable_global", @@ -1296,8 +1322,8 @@ def go_repositories(): name = "com_github_googleapis_enterprise_certificate_proxy", build_file_proto_mode = "disable_global", importpath = "github.com/googleapis/enterprise-certificate-proxy", - sum = "h1:7MYGT2XEMam7Mtzv1yDUYXANedWvwk3HKkR3MyGowy8=", - version = "v0.0.0-20220520183353-fd19c99a87aa", + sum = "h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw=", + version = "v0.1.0", ) go_repository( @@ -1425,6 +1451,14 @@ def go_repositories(): sum = "h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=", version = "v0.5.2", ) + go_repository( + name = "com_github_hashicorp_go_getter", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-getter", + sum = "h1:7jX7xcB+uVCliddZgeKyNxv0xoT7qL5KDtH7rU4IqIk=", + version = "v1.6.2", + ) + go_repository( name = "com_github_hashicorp_go_hclog", build_file_proto_mode = "disable_global", @@ -1490,6 +1524,20 @@ def go_repositories(): sum = "h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=", version = "v1.0.1", ) + go_repository( + name = "com_github_hashicorp_go_safetemp", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-safetemp", + sum = "h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_go_version", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-version", + sum = "h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0=", + version = "v1.1.0", + ) go_repository( name = "com_github_hashicorp_golang_lru", @@ -1700,10 +1748,9 @@ def go_repositories(): name = "com_github_kortschak_utter", build_file_proto_mode = "disable_global", importpath = "github.com/kortschak/utter", - sum = "h1:AJVccwLrdrikvkH0aI5JKlzZIORLpfMeGBQ5tHfIXis=", - version = "v1.0.1", + sum = "h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ=", + version = "v1.11.2", ) - go_repository( name = "com_github_kr_fs", build_file_proto_mode = "disable_global", @@ -1964,6 +2011,13 @@ def go_repositories(): sum = "h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw=", version = "v1.1.2", ) + go_repository( + name = "com_github_mattn_go_runewidth", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-runewidth", + sum = "h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=", + version = "v0.0.4", + ) go_repository( name = "com_github_mitchellh_copystructure", @@ -2664,6 +2718,13 @@ def go_repositories(): sum = "h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA=", version = "v0.0.0-20210104183010-2eb08e3e575f", ) + go_repository( + name = "com_github_ulikunitz_xz", + build_file_proto_mode = "disable_global", + importpath = "github.com/ulikunitz/xz", + sum = "h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ=", + version = "v0.5.8", + ) go_repository( name = "com_github_xeipuuv_gojsonpointer", @@ -2832,6 +2893,13 @@ def go_repositories(): sum = "h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=", version = "v1.0.0-20201130134442-10cb98267c6c", ) + go_repository( + name = "in_gopkg_cheggaaa_pb_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/cheggaaa/pb.v1", + sum = "h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo=", + version = "v1.0.27", + ) go_repository( name = "in_gopkg_errgo_v2", @@ -3341,8 +3409,8 @@ def go_repositories(): name = "org_golang_google_api", build_file_proto_mode = "disable_global", importpath = "google.golang.org/api", - sum = "h1:NMB9J4cCxs9xEm+1Z9QiO3eFvn7EnQj3Eo3hN6ugVlg=", - version = "v0.84.0", + sum = "h1:ZAnyOHQFIuWso1BodVfSaRyffD74T9ERGFa3k1fNk/U=", + version = "v0.86.0", ) go_repository( diff --git a/tools/update-deps/go.mod b/tools/update-deps/go.mod index 68f1b8c005..0f98be1a8a 100644 --- a/tools/update-deps/go.mod +++ b/tools/update-deps/go.mod @@ -2,6 +2,6 @@ module github.com/tools/update-deps go 1.18 -require golang.org/x/mod v0.5.1 +require golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 require golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect diff --git a/tools/update-deps/go.sum b/tools/update-deps/go.sum index b38eb3d6ca..c4806b3a6a 100644 --- a/tools/update-deps/go.sum +++ b/tools/update-deps/go.sum @@ -4,6 +4,8 @@ golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 7fdd45e40c983c27e54c72e1b8363afa794ba7f2 Mon Sep 17 00:00:00 2001 From: Arman Jindal Date: Wed, 6 Jul 2022 12:57:34 +0200 Subject: [PATCH 3/7] [#3397] Change CLI for AWS to use Terraform --- .gitignore | 1 + BUILD | 1 + cli/pkg/cmd/create/create.go | 112 ++-- cli/pkg/providers/aws/BUILD | 10 +- cli/pkg/providers/aws/aws.go | 487 ++---------------- cli/pkg/providers/minikube/minikube.go | 16 +- cli/pkg/providers/provider.go | 2 + cli/pkg/workspace/BUILD | 1 - cli/pkg/workspace/init.go | 30 +- .../getting-started/installation/terraform.md | 150 +++++- docs/sidebars.js | 1 + go_repositories.bzl | 37 +- 12 files changed, 244 insertions(+), 604 deletions(-) diff --git a/.gitignore b/.gitignore index a99c524bc8..0cc898f0a9 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ package-lock.json *.tfstate.* .terraform.tfstate.lock.info .terraform.lock.hcl +/terraform # Kubernetes .kubeconfig diff --git a/BUILD b/BUILD index a25ae7809f..a30bd37195 100644 --- a/BUILD +++ b/BUILD @@ -181,6 +181,7 @@ exports_files( # gazelle:proto disable_global # gazelle:build_file_name BUILD # gazelle:prefix +# gazelle:exclude infrastructure/terraform gazelle(name = "gazelle") nogo( diff --git a/cli/pkg/cmd/create/create.go b/cli/pkg/cmd/create/create.go index 77c76c9a69..08df0aa44c 100644 --- a/cli/pkg/cmd/create/create.go +++ b/cli/pkg/cmd/create/create.go @@ -65,11 +65,21 @@ func create(cmd *cobra.Command, args []string) { overrides.Version = version overrides.Namespace = namespace overrides.TrackingDisabled = disableTracking - dir, err := workspace.Create(workspacePath, overrides, providerName) + if err := provider.CheckEnvironment(); err != nil { + console.Exit("please set up the required environment for the installation", err) + } + + dir, err := workspace.Create(workspacePath, overrides) if err != nil { console.Exit("could not initialize Airy workspace directory", err) } fmt.Println("📁 Initialized Airy workspace directory at", dir.GetPath(".")) + + installDir, err := provider.PreInstallation(dir.GetPath(".")) + if err != nil { + console.Exit("could not set up files for install in Airy workspace directory", err) + } + fmt.Println("📁 Set up installation directory in the Airy workspace at", installDir) if initOnly { os.Exit(0) } @@ -78,69 +88,69 @@ func create(cmd *cobra.Command, args []string) { fmt.Fprintln(w) fmt.Fprintln(w, providerName, "provider output:") fmt.Fprintln(w) - context, err := provider.Provision(providerConfig, dir) + context, err := provider.Provision(providerConfig, workspace.ConfigDir{Path: installDir}) fmt.Fprintln(w) if err != nil { - console.Exit("could not provision cluster: ", err) - } - - fmt.Println("✅ Cluster provisioned") - - clientset, err := context.GetClientSet() - if err != nil { - console.Exit("could not get clientset: ", err) + console.Exit("could not install Airy: ", err) } + if providerName == "minikube" { // TEMP fix to keep minikube working + clientset, err := context.GetClientSet() + if err != nil { + console.Exit("could not get clientset: ", err) + } - if err = context.Store(); err != nil { - console.Exit("could not store the kube context: ", err) - } + if err = context.Store(); err != nil { + console.Exit("could not store the kube context: ", err) + } - helm := helm.New(clientset, version, namespace, dir.GetAiryYaml()) - if err := helm.Setup(); err != nil { - console.Exit("setting up Helm failed with err: ", err) - } + helm := helm.New(clientset, version, namespace, dir.GetAiryYaml()) + if err := helm.Setup(); err != nil { + console.Exit("setting up Helm failed with err: ", err) + } - fmt.Println("🚀 Starting airy with default components") + fmt.Println("🚀 Starting core with default components") - if err := helm.InstallCharts(); err != nil { - console.Exit("installing Helm charts failed with err: ", err) - } + if err := helm.InstallCharts(); err != nil { + console.Exit("installing Helm charts failed with err: ", err) + } - if err = provider.PostInstallation(providerConfig, namespace, dir); err != nil { - console.Exit("failed to run post installation hook: ", err) - } + if err = provider.PostInstallation(providerConfig, namespace, dir); err != nil { + console.Exit("failed to run post installation hook: ", err) + } - fmt.Println("🎉 Your Airy Core is ready") + fmt.Println("🎉 Your Airy Core is ready") - coreConfig, err := k8s.GetCmData("core-config", namespace, clientset) - if err != nil { - console.Exit("failed to get hosts from installation") - } + coreConfig, err := k8s.GetCmData("core-config", namespace, clientset) + if err != nil { + console.Exit("failed to get hosts from installation") + } - fmt.Println("\t 👩‍🍳 Available hosts:") - for hostName, host := range coreConfig { - switch hostName { - case "HOST": - fmt.Printf("\t\t %s:\t %s", "Host", host) - fmt.Println() - case "API_HOST": - fmt.Printf("\t\t %s:\t %s", "API", host) - fmt.Println() - case "NGROK": - fmt.Printf("\t\t %s:\t %s", "NGROK", host) - fmt.Println() + fmt.Println("\t 👩‍🍳 Available hosts:") + for hostName, host := range coreConfig { + switch hostName { + case "HOST": + fmt.Printf("\t\t %s:\t %s", "Host", host) + fmt.Println() + case "API_HOST": + fmt.Printf("\t\t %s:\t %s", "API", host) + fmt.Println() + case "NGROK": + fmt.Printf("\t\t %s:\t %s", "NGROK", host) + fmt.Println() + } } - } - fmt.Println() + fmt.Println("✅ Airy Installed") + fmt.Println() - viper.Set("provider", provider) - viper.Set("namespace", namespace) - viper.WriteConfig() + viper.Set("provider", provider) + viper.Set("namespace", namespace) + viper.WriteConfig() - airyAnalytics.Track(analytics.Track{ - UserId: coreConfig["CORE_ID"], - Event: "installation_succesful"}) - fmt.Printf("📚 For more information about the %s provider visit https://airy.co/docs/core/getting-started/installation/%s", providerName, providerName) - fmt.Println() + airyAnalytics.Track(analytics.Track{ + UserId: coreConfig["CORE_ID"], + Event: "installation_succesful"}) + fmt.Printf("📚 For more information about the %s provider visit https://airy.co/docs/core/getting-started/installation/%s", providerName, providerName) + fmt.Println() + } } diff --git a/cli/pkg/providers/aws/BUILD b/cli/pkg/providers/aws/BUILD index 56766c987c..52c3173890 100644 --- a/cli/pkg/providers/aws/BUILD +++ b/cli/pkg/providers/aws/BUILD @@ -17,15 +17,7 @@ go_library( "//cli/pkg/kube", "//cli/pkg/workspace", "//cli/pkg/workspace/template", - "@com_github_aws_aws_sdk_go//aws", - "@com_github_aws_aws_sdk_go_v2_config//:config", - "@com_github_aws_aws_sdk_go_v2_service_ec2//:ec2", - "@com_github_aws_aws_sdk_go_v2_service_ec2//types", - "@com_github_aws_aws_sdk_go_v2_service_eks//:eks", - "@com_github_aws_aws_sdk_go_v2_service_eks//types", - "@com_github_aws_aws_sdk_go_v2_service_iam//:iam", - "@com_github_aws_aws_sdk_go_v2_service_iam//types", - "@com_github_twinproduction_go_color//:go-color", + "@com_github_hashicorp_go_getter//:go-getter", "@in_gopkg_segmentio_analytics_go_v3//:analytics-go_v3", ], ) diff --git a/cli/pkg/providers/aws/aws.go b/cli/pkg/providers/aws/aws.go index a572ca70d1..ad90420bb3 100644 --- a/cli/pkg/providers/aws/aws.go +++ b/cli/pkg/providers/aws/aws.go @@ -5,36 +5,21 @@ import ( "cli/pkg/kube" "cli/pkg/workspace" tmpl "cli/pkg/workspace/template" - "context" - "fmt" "io" "math/rand" "os" + "os/exec" "strings" - "text/template" "time" + getter "github.com/hashicorp/go-getter" "gopkg.in/segmentio/analytics-go.v3" - - "github.com/TwinProduction/go-color" - "github.com/aws/aws-sdk-go-v2/config" - "github.com/aws/aws-sdk-go-v2/service/ec2" - ec2Types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/aws-sdk-go-v2/service/eks" - eksTypes "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/aws-sdk-go-v2/service/iam" - iamTypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/aws/aws-sdk-go/aws" ) var letters = []rune("abcdefghijklmnopqrstuvwxyz") type provider struct { - context kube.KubeCtx w io.Writer - ec2Client *ec2.Client - iamClient *iam.Client - eksClient *eks.Client analytics console.AiryAnalytics } @@ -50,6 +35,28 @@ func (p *provider) GetOverrides() tmpl.Variables { LoadbalancerAnnotations: map[string]string{"service.beta.kubernetes.io/aws-load-balancer-type": "nlb"}, } } +func (p *provider) CheckEnvironment() error { + return workspace.CheckBinaries([]string{"terraform", "aws"}) +} +func (p *provider) PreInstallation(workspacePath string) (string, error) { + remoteUrl := "github.com/airyhq/airy/infrastructure/terraform/install" + installDir := workspacePath + "/terraform" + installFlags := strings.Join([]string{"PROVIDER=aws-eks", "WORKSPACE=" + workspacePath}, "\n") + + var gitGetter = &getter.Client{ + Src: remoteUrl, + Dst: installDir, + Dir: true, + } + if err := gitGetter.Get(); err != nil { + return "", err + } + err := os.WriteFile(installDir+"/install.flags", []byte(installFlags), 0666) + if err != nil { + return "", err + } + return installDir, nil +} func (p *provider) PostInstallation(providerConfig map[string]string, namespace string, dir workspace.ConfigDir) error { return nil @@ -62,13 +69,7 @@ type KubeConfig struct { } func (p *provider) Provision(providerConfig map[string]string, dir workspace.ConfigDir) (kube.KubeCtx, error) { - fmt.Fprintf(p.w, "Hello... is it me your looking for???") - console.Exit("Arman :)") - cfg, err := config.LoadDefaultConfig(context.TODO()) - if err != nil { - console.Exit(err) - } - + installPath := dir.GetPath(".") id := RandString(8) p.analytics.Track(analytics.Identify{ AnonymousId: id, @@ -76,445 +77,23 @@ func (p *provider) Provision(providerConfig map[string]string, dir workspace.Con Set("provider", "AWS"), }) name := "Airy-" + id - fmt.Fprintf(p.w, "Creating Airy Core instance with id: %s. This might take a while.\n", name) - p.iamClient = iam.NewFromConfig(cfg) - - role, err := p.createRole(name) - if err != nil { - console.Exit("Error creating role: ", err) - } - fmt.Fprintf(p.w, "Created AWS Role with ARN: %s.\n", *role.Arn) - - if err = p.attachPolicies(role.RoleName); err != nil { - console.Exit("Error attaching policies: ", err) - } - - fmt.Fprintf(p.w, "EKS policies attached.\n") - - p.ec2Client = ec2.NewFromConfig(cfg) - - var subnetIds []string - instanceType := providerConfig["instanceType"] - if instanceType == "" { - instanceType = "c5.xlarge" - } - - vpcId := providerConfig["vpcId"] - if vpcId == "" { - vpc, err := p.createVpc("192.168.0.0/16", name) - if err != nil { - console.Exit("Error creating vpc: ", err) - } - vpcId = *vpc.VpcId - fmt.Fprintf(p.w, "VPC created with id: %s.\n", vpcId) - fmt.Fprintf(p.w, "Enabling DNS on VPC...\n") - if err = p.enableDNSOnVpc(&vpcId); err != nil { - console.Exit("Error enabling DNS on VPC.", err) - } - - fmt.Fprintf(p.w, "Creating Internet Gateway...\n") - internetGateway, err := p.createInternetGateway(&vpcId) - if err != nil { - console.Exit("Could not create internet gateway: ", err) - } - - fmt.Fprintf(p.w, "Creating route table...\n") - routeTable, err := p.createRoute(&vpcId, name, internetGateway) - if err != nil { - console.Exit("Error creating route table: ", err) - } - - availabilityZones, azErr := p.ec2Client.DescribeAvailabilityZones(context.TODO(), &ec2.DescribeAvailabilityZonesInput{}) - if azErr != nil { - console.Exit("Unable to get availability zones. Make sure you have set the ENV variable AWS_REGION") - } - fmt.Fprintf(p.w, "Creating first subnet...\n") - firstSubnet, err := p.createSubnet(&vpcId, name, "192.168.64.0/18", *availabilityZones.AvailabilityZones[0].ZoneName) - if err != nil { - console.Exit("Error creating subnet: ", err) - } - - fmt.Fprintf(p.w, "Creating second subnet\n") - secondSubnet, err := p.createSubnet(&vpcId, name, "192.168.128.0/18", *availabilityZones.AvailabilityZones[1].ZoneName) - if err != nil { - console.Exit("Error creating subnet: ", err) - } - - fmt.Fprintf(p.w, "Allowing public IP on first subnet...\n") - if err = p.allowPublicIpOnSubnet(firstSubnet.SubnetId); err != nil { - console.Exit("Error allowing public IP on first subnet: ", err) - } - - fmt.Fprintf(p.w, "Allowing public IP on second subnet...\n") - if err = p.allowPublicIpOnSubnet(secondSubnet.SubnetId); err != nil { - console.Exit("Error allowing public IP on second subnet: ", err) - } - - fmt.Fprintf(p.w, "Associating first subnet to route table...\n") - if err = p.associateSubnetToRouteTable(firstSubnet.SubnetId, routeTable.RouteTableId); err != nil { - console.Exit("Error associating first subnet to route table: ", err) - } - - fmt.Fprintf(p.w, "Associating second subnet to route table...\n") - if err = p.associateSubnetToRouteTable(secondSubnet.SubnetId, routeTable.RouteTableId); err != nil { - console.Exit("Error associating second subnet to route table: ", err) - } - - subnetIds = append(subnetIds, *firstSubnet.SubnetId) - subnetIds = append(subnetIds, *secondSubnet.SubnetId) - } else { - fmt.Fprintf(p.w, "Using existing VPC: %s.\n", vpcId) - subnets, subnetErr := p.getSubnets(vpcId) - if subnetErr != nil { - console.Exit("Unable to get subnets from VPC", subnetErr) - } - subnetIds = subnets - fmt.Fprintf(p.w, "Using subnets: %s.\n", strings.Join(subnets[:], ",")) - } - - p.eksClient = eks.NewFromConfig(cfg) - fmt.Fprintf(p.w, "Creating EKS cluster...\n") - - cluster, err := p.createCluster(name, role.Arn, subnetIds) - if err != nil { - console.Exit("Error creating cluster: ", err) - } - fmt.Fprintf(p.w, "Created EKS cluster named: %s.\n", *cluster.Name) - - fmt.Fprintf(p.w, "Waiting for cluster to be ready") - p.waitUntilResourceReady(func() bool { - describeClusterResult, err := p.eksClient.DescribeCluster(context.TODO(), &eks.DescribeClusterInput{ - Name: aws.String(name), - }) - - if err != nil { - fmt.Fprintf(p.w, "Error fetching cluster information. Trying it again.\n") - return false - } + cmd := exec.Command("/bin/bash", "install.sh") + cmd.Dir = installPath + cmd.Stdin = os.Stdin + cmd.Stderr = p.w + cmd.Stdout = p.w + err := cmd.Run() - return describeClusterResult.Cluster.Status == "ACTIVE" - }) - - nodeGroup, err := p.createNodeGroup(name, role.Arn, subnetIds, instanceType) - if err != nil { - console.Exit("Error creating node group: ", err) - } - - fmt.Fprintf(p.w, "Node group created %s.\n", *nodeGroup.NodegroupName) - fmt.Fprintf(p.w, "Waiting for node group to be ready") - p.waitUntilResourceReady(func() bool { - describeNodegroupResult, err := p.eksClient.DescribeNodegroup(context.TODO(), &eks.DescribeNodegroupInput{ - ClusterName: aws.String(name), - NodegroupName: aws.String(name), - }) - - if err != nil { - fmt.Fprintf(p.w, "Error fetching node group information. Trying it again.") - return false - } - - return describeNodegroupResult.Nodegroup.Status == "ACTIVE" - }) - - describeClusterResult, err := p.eksClient.DescribeCluster(context.TODO(), &eks.DescribeClusterInput{ - Name: aws.String(name), - }) if err != nil { - console.Exit("Error describing cluster: ", err) + console.Exit("Error with Terraform installation", err) } - - cluster = describeClusterResult.Cluster - kubeConfig := KubeConfig{ - ClusterName: name, - EndpointUrl: *cluster.Endpoint, - CertificateData: *cluster.CertificateAuthority.Data, - } - kubeConfigFilePath, err := p.createKubeConfigFile(dir, kubeConfig) - - if err != nil { - console.Exit("Error creating kube config file: ", err) - } - ctx := kube.KubeCtx{ - KubeConfigPath: kubeConfigFilePath, + KubeConfigPath: "./kube.conf", // change this into a CLI ContextName: name, } - - p.context = ctx return ctx, nil } -func (p *provider) createRole(name string) (*iamTypes.Role, error) { - createRoleInput := &iam.CreateRoleInput{ - AssumeRolePolicyDocument: aws.String(RolePolicyDocument), - Path: aws.String("/"), - RoleName: aws.String(name), - } - iamResult, err := p.iamClient.CreateRole(context.TODO(), createRoleInput) - - if err != nil { - return nil, err - } - - return iamResult.Role, nil -} - -func (p *provider) createVpc(cidr string, name string) (*ec2Types.Vpc, error) { - vpcTagList := ec2Types.TagSpecification{ - ResourceType: ec2Types.ResourceTypeVpc, - Tags: []ec2Types.Tag{ - { - Key: aws.String("Name"), Value: aws.String(name), - }, - }, - } - - createVpcResult, err := p.ec2Client.CreateVpc(context.TODO(), &ec2.CreateVpcInput{ - CidrBlock: aws.String(cidr), - TagSpecifications: []ec2Types.TagSpecification{vpcTagList}, - }) - - if err != nil { - return nil, err - } - return createVpcResult.Vpc, nil -} - -func (p *provider) enableDNSOnVpc(vpcId *string) error { - value := true - _, err := p.ec2Client.ModifyVpcAttribute(context.TODO(), &ec2.ModifyVpcAttributeInput{ - VpcId: vpcId, - EnableDnsSupport: &ec2Types.AttributeBooleanValue{ - Value: &value, - }, - }) - - if err != nil { - return err - } - - _, err = p.ec2Client.ModifyVpcAttribute(context.TODO(), &ec2.ModifyVpcAttributeInput{ - VpcId: vpcId, - EnableDnsHostnames: &ec2Types.AttributeBooleanValue{ - Value: &value, - }, - }) - - return err -} - -func (p *provider) createInternetGateway(vpcId *string) (*ec2Types.InternetGateway, error) { - createInternetGatewayResult, err := p.ec2Client.CreateInternetGateway(context.TODO(), &ec2.CreateInternetGatewayInput{}) - if err != nil { - return nil, err - } - - _, err = p.ec2Client.AttachInternetGateway(context.TODO(), &ec2.AttachInternetGatewayInput{ - InternetGatewayId: createInternetGatewayResult.InternetGateway.InternetGatewayId, - VpcId: vpcId, - }) - if err != nil { - return nil, err - } - return createInternetGatewayResult.InternetGateway, nil -} - -func (p *provider) createRoute(vpcId *string, name string, internetGateway *ec2Types.InternetGateway) (*ec2Types.RouteTable, error) { - routeTableTagList := ec2Types.TagSpecification{ - ResourceType: ec2Types.ResourceTypeRouteTable, - Tags: []ec2Types.Tag{ - { - Key: aws.String("Network"), Value: aws.String("Public"), - }, - { - Key: aws.String("Id"), Value: aws.String(name), - }, - }, - } - createRouteTable, err := p.ec2Client.CreateRouteTable(context.TODO(), &ec2.CreateRouteTableInput{ - VpcId: vpcId, - TagSpecifications: []ec2Types.TagSpecification{routeTableTagList}, - }) - if err != nil { - return nil, err - } - _, err = p.ec2Client.CreateRoute(context.TODO(), &ec2.CreateRouteInput{ - RouteTableId: createRouteTable.RouteTable.RouteTableId, - DestinationCidrBlock: aws.String("0.0.0.0/0"), - GatewayId: internetGateway.InternetGatewayId, - }) - - if err != nil { - return nil, err - } - return createRouteTable.RouteTable, nil -} - -func (p *provider) createSubnet(vpcId *string, name string, cidr string, availabilityZone string) (*ec2Types.Subnet, error) { - subnetTagList := ec2Types.TagSpecification{ - ResourceType: ec2Types.ResourceTypeSubnet, - Tags: []ec2Types.Tag{ - { - Key: aws.String("kubernetes.io/role/elb"), Value: aws.String("1"), - }, - { - Key: aws.String("Id"), Value: aws.String(name), - }, - }, - } - subnetResult, err := p.ec2Client.CreateSubnet(context.TODO(), &ec2.CreateSubnetInput{ - VpcId: vpcId, - CidrBlock: aws.String(cidr), - AvailabilityZone: aws.String(availabilityZone), - TagSpecifications: []ec2Types.TagSpecification{subnetTagList}, - }) - if err != nil { - return nil, err - } - - return subnetResult.Subnet, nil - -} - -func (p *provider) getSubnets(vpcId string) ([]string, error) { - var subnets []string - result, err := p.ec2Client.DescribeSubnets(context.TODO(), &ec2.DescribeSubnetsInput{ - Filters: []ec2Types.Filter{ - { - Name: aws.String("vpc-id"), - Values: []string{ - *aws.String(vpcId), - }, - }, - }, - }) - - for i := range result.Subnets { - if *result.Subnets[i].MapPublicIpOnLaunch == true { - subnets = append(subnets, *result.Subnets[i].SubnetId) - } - } - return subnets, err -} - -func (p *provider) allowPublicIpOnSubnet(subnetId *string) error { - value := true - _, err := p.ec2Client.ModifySubnetAttribute(context.TODO(), &ec2.ModifySubnetAttributeInput{ - SubnetId: subnetId, - MapPublicIpOnLaunch: &ec2Types.AttributeBooleanValue{ - Value: &value, - }, - }) - - return err -} - -func (p *provider) associateSubnetToRouteTable(subnetId *string, routeTableId *string) error { - _, err := p.ec2Client.AssociateRouteTable(context.TODO(), &ec2.AssociateRouteTableInput{ - RouteTableId: routeTableId, - SubnetId: subnetId, - }) - - return err -} - -func (p *provider) createCluster(name string, roleArn *string, subnetIds []string) (*eksTypes.Cluster, error) { - createdCluster, err := p.eksClient.CreateCluster(context.TODO(), &eks.CreateClusterInput{ - Name: aws.String(name), - RoleArn: roleArn, - ResourcesVpcConfig: &eksTypes.VpcConfigRequest{ - SubnetIds: subnetIds, - }, - Tags: map[string]string{"Id": name}, - }) - - if err != nil { - return nil, err - } - - return createdCluster.Cluster, nil - -} - -func (p *provider) createNodeGroup(name string, roleArn *string, subnetIds []string, instanceType string) (*eksTypes.Nodegroup, error) { - tagKey := "kubernetes.io/cluster/" + name - createdNodeGroup, err := p.eksClient.CreateNodegroup(context.TODO(), &eks.CreateNodegroupInput{ - AmiType: "AL2_x86_64", - ClusterName: aws.String(name), - InstanceTypes: []string{instanceType}, - NodeRole: roleArn, - NodegroupName: aws.String(name), - Subnets: subnetIds, - Tags: map[string]string{tagKey: "owned"}, - }) - - if err != nil { - return nil, err - } - - return createdNodeGroup.Nodegroup, nil -} - -func (p *provider) createKubeConfigFile(dir workspace.ConfigDir, kubeConfig KubeConfig) (string, error) { - tmpl, err := template.New("kube-template").Parse(KubeConfigTemplate) - if err != nil { - console.Exit("error parsing template", err) - } - - path := dir.GetPath("kube.conf") - kubeConfigFile, err := os.Create(path) - defer kubeConfigFile.Close() - - if err != nil { - return "", err - } - return path, tmpl.Execute(kubeConfigFile, kubeConfig) -} - -func (p *provider) attachPolicies(roleName *string) error { - policies := [...]string{"arn:aws:iam::aws:policy/AmazonEKSClusterPolicy", - "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", - "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly", - "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", - } - - for _, policyName := range policies { - policyInput := &iam.AttachRolePolicyInput{ - RoleName: roleName, - PolicyArn: aws.String(policyName), - } - _, errAttach := p.iamClient.AttachRolePolicy(context.TODO(), policyInput) - if errAttach != nil { - fmt.Fprintf(p.w, "%v\n", errAttach.Error()) - return errAttach - } - } - - return nil -} - -func (p *provider) waitUntilResourceReady(f func() bool) { - timeout := time.After(20 * time.Minute) - tick := time.Tick(10 * time.Second) - l := console.GetMiddleware(func(input string) string { - return color.Colorize(color.Cyan, input) - }) - for { - select { - case <-tick: - if f() { - fmt.Fprintf(l, "\n") - return - } - fmt.Fprintf(l, ".") - case <-timeout: - fmt.Fprintf(p.w, "Timeout when checking if resource is ready\n") - return - } - } - -} - func RandString(n int) string { rand.Seed(time.Now().UnixNano()) b := make([]rune, n) diff --git a/cli/pkg/providers/minikube/minikube.go b/cli/pkg/providers/minikube/minikube.go index e2e86c1a6a..7a937972f3 100644 --- a/cli/pkg/providers/minikube/minikube.go +++ b/cli/pkg/providers/minikube/minikube.go @@ -44,11 +44,14 @@ func (p *provider) GetOverrides() template.Variables { } } -func (p *provider) Provision(providerConfig map[string]string, dir workspace.ConfigDir) (kube.KubeCtx, error) { - if err := checkInstallation(); err != nil { - return kube.KubeCtx{}, err - } +func (p *provider) CheckEnvironment() error { + return workspace.CheckBinaries([]string{"minikube"}) +} +func (p *provider) PreInstallation(workspace string) (string, error) { + return workspace, nil +} +func (p *provider) Provision(providerConfig map[string]string, dir workspace.ConfigDir) (kube.KubeCtx, error) { if err := p.startCluster(providerConfig); err != nil { return kube.KubeCtx{}, err } @@ -63,11 +66,6 @@ func (p *provider) Provision(providerConfig map[string]string, dir workspace.Con return ctx, nil } -func checkInstallation() error { - _, err := exec.LookPath(minikube) - return err -} - func (p *provider) startCluster(providerConfig map[string]string) error { minikubeDriver := getArg(providerConfig, "driver", "docker") minikubeCpus := getArg(providerConfig, "cpus", "4") diff --git a/cli/pkg/providers/provider.go b/cli/pkg/providers/provider.go index 84e72285c9..a50841b76a 100644 --- a/cli/pkg/providers/provider.go +++ b/cli/pkg/providers/provider.go @@ -21,6 +21,8 @@ const ( type Provider interface { Provision(providerConfig map[string]string, dir workspace.ConfigDir) (kube.KubeCtx, error) GetOverrides() template.Variables + CheckEnvironment() error + PreInstallation(workspace string) (string, error) PostInstallation(providerConfig map[string]string, namespace string, dir workspace.ConfigDir) error } diff --git a/cli/pkg/workspace/BUILD b/cli/pkg/workspace/BUILD index bb2e85a923..d090212822 100644 --- a/cli/pkg/workspace/BUILD +++ b/cli/pkg/workspace/BUILD @@ -11,7 +11,6 @@ go_library( deps = [ "//cli/pkg/workspace/template", "//lib/go/config", - "@com_github_hashicorp_go_getter//:go-getter", "@com_github_spf13_viper//:viper", "@in_gopkg_yaml_v2//:yaml_v2", ], diff --git a/cli/pkg/workspace/init.go b/cli/pkg/workspace/init.go index 5caecdd28c..c9286dec60 100644 --- a/cli/pkg/workspace/init.go +++ b/cli/pkg/workspace/init.go @@ -3,10 +3,11 @@ package workspace import ( "cli/pkg/workspace/template" "fmt" - getter "github.com/hashicorp/go-getter" - "github.com/spf13/viper" "os" + "os/exec" "path/filepath" + + "github.com/spf13/viper" ) func Init(path string) (ConfigDir, error) { @@ -47,7 +48,7 @@ func getConfigPath(path string) string { return path } -func Create(path string, data template.Variables, providerName string) (ConfigDir, error) { +func Create(path string, data template.Variables) (ConfigDir, error) { path = getConfigPath(path) if _, err := os.Stat(path); os.IsNotExist(err) { err = os.MkdirAll(path, 0755) @@ -63,24 +64,17 @@ func Create(path string, data template.Variables, providerName string) (ConfigDi viper.AddConfigPath(getConfigPath(path)) viper.SetConfigType("yaml") viper.SetConfigName(cliConfigFileName) - // Init viper config err := viper.WriteConfigAs(filepath.Join(path, cliConfigFileName)) - if providerName == "aws" { - remoteUrl := "github.com/airyhq/airy/infrastructure/terraform/install" - dst := path + "/terraform" - var gitGetter = &getter.Client{ - Src: remoteUrl, - Dst: dst, - Dir: true, - } + return ConfigDir{Path: path}, err +} - if err := gitGetter.Get(); err != nil { - fmt.Printf("err %v", err) +func CheckBinaries(binaryList []string) error { + for _, binary := range binaryList { + _, err := exec.LookPath(binary) + if err != nil { + return err } - return ConfigDir{Path: path}, err } - - // TODO - return ConfigDir{Path: path}, err + return nil } diff --git a/docs/docs/getting-started/installation/terraform.md b/docs/docs/getting-started/installation/terraform.md index 60cbd78f39..fbceb37f09 100644 --- a/docs/docs/getting-started/installation/terraform.md +++ b/docs/docs/getting-started/installation/terraform.md @@ -3,52 +3,148 @@ title: Run Airy Core on AWS with Terraform sidebar_label: Terraform --- + +Create a cluster and run Airy Core using Terraform. + + +The goal of this document is to provide a step-by-step guide to setting up `Airy Core` on a Kubernetes Cluster using the infrastructure-as-code tool [Terraform](https://www.terraform.io/). Terraform takes care of provisioning, updating, and cleaning up virtual resources. + +:::note + +Currently, we only support the AWS Elastic Kubernetes Service (AWS-EKS) as a provider. Terraform modules for other providers (and on different architectures) such as Google Cloud and Digital Ocean will soon be added. + +::: + ## Requirements -- [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) v1.0.0+ -- [Airy CLI](https://airy.co/docs/core/cli/introduction) v0.34.0+ -- [SSH key](https://www.ssh.com/academy/ssh/keygen) in `~/.ssh/id_rsa.pub` +- [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) v1.2.0+ - [Kubectl](https://kubernetes.io/docs/tasks/tools/) (optional) -## Create the Kubernetes cluster +## Architecture + +The local file structure for the installation is as follows: + +``` +[Airy Workspace Directory] + airy.yaml + cli.yaml + /[INSTALLATION DIRECTORY] + /airy-core + main.tf + variables.tf + outputs.tf + /[PROVIDER] + main.tf + variables.tf + outputs.tf +``` + +The installation takes place in two steps, each in a separate Terraform environment organized by directories: + +- 1. `/[PROVIDER]` (default = `aws-eks`) - where you create the cluster. +- 2. `/airy-core`- where `Airy Core` is installed on the cluster. + +In each directory, the `main.tf` is the root module of a remote parent [module](https://www.terraform.io/language/modules/syntax) of the same name in our GitHub [repository](https://github.com/airyhq/airy/tree/develop/infrastructure/terraform/modules) (airy/infrastructure/terraform/modules). + +## Install step by step + +:::note + +When you run a cloud installation with the Airy CLI with `airy create --provider cloud-provider`, the CLI will run all the following steps in a sequence. Currently, only the AWS EKS (aws-eks) provider is supported. + +If you already have a cluster installed without Terraform, i.e. via [Helm](../installation/helm.md), skip Step 4 and place the Kubernetes config file in the installation directory. Remember to specify the location of this file in the `main.tf` of `airy-core`. + +::: + +### 1. Create Airy Workspace + +Create a directory with an `airy.yaml` and `cli.yaml` file. If you skip this step, the CLI will create it for you. + +### 2. Create the installation directory inside Airy Workspace + +```sh +mkdir terraform +``` + +### 3. Set up files inside Installation Directory + +Copy/Download `airy-core` and the relevant provider directory from [airy/infrastructure/terraform/install](https://github.com/airyhq/airy/tree/develop/infrastructure/terraform/install). + +This can be done by `git clone git@github.com:airyhq/airy.git` and then moving the relevant files. +Or grab the files inside your installation directory directly (and select the provider directory). + +``` +$ cd terraform +$ svn export https://github.com/airyhq/airy/trunk/infrastructure/terraform/install/airy-core +$ svn export https://github.com/airyhq/airy/trunk/infrastructure/terraform/install/[PROVIDER] +``` -In case you already have a cluster running you can skip to the next section. +### 4. Create Kubernetes Cluster -### Amazon Web Services +:::note -You need to provide Terraform with the AWS credentials for your IAM Role. If -you don't know how to create one, [follow these -instructions](https://aws.amazon.com/premiumsupport/knowledge-center/create-access-key/). -They have to be put into a `terraform.tfvars` file in `terraform/kubernetes` that looks contains: +Every provider has its own requirements for creating and accessing the Kubernetes cluster. For AWS check the following [requirements](../installation/aws#configure-aws). + +::: + +Change into your `/[PROVIDER]` directory. ``` -aws_access_key = "" -aws_secret_key = "" +cd [PROVIDER] +$ terraform init +$ terraform apply ``` -If you want to deploy the EKS cluster in your existing VPC you have to override the -`vpc_id`, `subnets` and `fargate_subnets` variables with the outputs from your -vpc and set `create_vpc=false` in the Airy Core module. +This will ask for the provider environmental variables, in the case of AWS: `aws_profile` and `aws_region`. You can provide these values when prompted on the Command Line or do one of the following alternatives: + +- export them as AWS_REGION and AWS_PROFILE, +- export them as TF_VAR_aws_region and TF_VAR_aws_profile, +- store them, in a `terraform.tfvars` file in the same provider directory. + +This step will take time, depending on the provider and architecture. Provisioning a full Kubernetes Cluster takes between 5 - 10 mins. On completion, it will output a `kube.conf` in the installation directory. + +### 5. Install Airy on Cluster ``` -terraform init -terraform apply +$ cd ../airy-core +$ terraform init +$ terraform apply ``` -## Install Airy Helm chart +Terraform will look for a Kube Config to connect to the cluster provisioned in Step 4. (or which you already have provisioned), and `helm` install `airy-core` onto it. -After the Kubernetes cluster has been created we can deploy the Airy Helm chart -to it. Change to the `terraform/main` directory and make sure the `.kubeconfig` -file is there. +This will output a link to your UI, API, and source URLs. -You can [configure](https://airy.co/docs/core/getting-started/installation/configuration) your instance by making changes to `infrastructure/terraform/main/files/values.yaml` +### 6. Verify the installation -If you want to deploy the stateless apps with AWS Fargate you can add -`workerType: fargate` to the `values.yaml` +Connect to your new instance using `kube.conf` file inside your installation directory. -Finally, you need to initialize the Terraform workspace and run apply. +`kubectl get pods --kubeconfig ./kube.conf` + +To uninstall, simply run `terraform destroy` in the `airy-core` directory first, and then once again in the `PROVIDER` directory. + +## Uninstall step by step + +For uninstalling Airy you need to destroy both of the environments that you have created. First destroy the `airy-core` environment: ``` -terraform init -terraform apply +$ cd ../airy-core +$ terraform destroy +``` + +Then destroy the PROVIDER environment: + ``` +cd [PROVIDER] +$ terraform destroy +``` + +## Install and uninstall using a script + +In the [airy/infrastructure/terraform/install](https://github.com/airyhq/airy/tree/develop/infrastructure/terraform/install), there are scripts: + +- `install.sh` +- `uninstall.sh` +- `install.flags` + +These scripts provide a simple interface for the installation/uninstallation process. They are also used by the Airy CLI and are useful to check the file structure as well as ensure correct install/uninstall order. diff --git a/docs/sidebars.js b/docs/sidebars.js index ee134e3c9c..824602ceb1 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -9,6 +9,7 @@ module.exports = { 'getting-started/installation/introduction', 'getting-started/installation/minikube', 'getting-started/installation/aws', + 'getting-started/installation/terraform', 'getting-started/installation/helm', 'getting-started/installation/configuration', 'getting-started/installation/security', diff --git a/go_repositories.bzl b/go_repositories.bzl index 5f9cb601f8..4226b71bcc 100644 --- a/go_repositories.bzl +++ b/go_repositories.bzl @@ -309,6 +309,8 @@ def go_repositories(): importpath = "github.com/bshuster-repo/logrus-logstash-hook", sum = "h1:e+C0SB5R1pu//O4MQ3f9cFuPGoOVeF2fE4Og9otCc70=", version = "v1.0.0", + ) + go_repository( name = "com_github_bgentry_go_netrc", build_file_proto_mode = "disable_global", importpath = "github.com/bgentry/go-netrc", @@ -714,13 +716,6 @@ def go_repositories(): sum = "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=", version = "v1.1.1", ) - go_repository( - name = "com_github_docopt_docopt_go", - build_file_proto_mode = "disable_global", - importpath = "github.com/docopt/docopt-go", - sum = "h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=", - version = "v0.0.0-20180111231733-ee0de3bc6815", - ) go_repository( name = "com_github_elazarl_goproxy", build_file_proto_mode = "disable_global", @@ -830,13 +825,6 @@ def go_repositories(): version = "v1.0.0", ) - go_repository( - name = "com_github_elazarl_goproxy", - build_file_proto_mode = "disable_global", - importpath = "github.com/elazarl/goproxy", - sum = "h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=", - version = "v0.0.0-20180725130230-947c36da3153", - ) go_repository( name = "com_github_emicklei_go_restful", build_file_proto_mode = "disable_global", @@ -852,20 +840,6 @@ def go_repositories(): version = "v3.8.0", ) - go_repository( - name = "com_github_envoyproxy_go_control_plane", - build_file_proto_mode = "disable_global", - importpath = "github.com/envoyproxy/go-control-plane", - sum = "h1:xvqufLtNVwAhN8NMyWklVgxnWohi+wtMGQMhtxexlm0=", - version = "v0.10.2-0.20220325020618-49ff273808a1", - ) - go_repository( - name = "com_github_emicklei_go_restful", - build_file_proto_mode = "disable_global", - importpath = "github.com/emicklei/go-restful", - sum = "h1:8KpYO/Xl/ZudZs5RNOEhWMBY4hmzlZhhRd9cu+jrZP4=", - version = "v2.15.0+incompatible", - ) go_repository( name = "com_github_envoyproxy_go_control_plane", build_file_proto_mode = "disable_global", @@ -2011,13 +1985,6 @@ def go_repositories(): sum = "h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw=", version = "v1.1.2", ) - go_repository( - name = "com_github_mattn_go_runewidth", - build_file_proto_mode = "disable_global", - importpath = "github.com/mattn/go-runewidth", - sum = "h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=", - version = "v0.0.4", - ) go_repository( name = "com_github_mitchellh_copystructure", From 75440eef5f3bbb28dc6aa5bc0e160b9af035c87b Mon Sep 17 00:00:00 2001 From: ljupcovangelski Date: Wed, 3 Aug 2022 12:09:01 +0200 Subject: [PATCH 4/7] Decouple status from kubernetes --- cli/pkg/cmd/status/BUILD | 1 - cli/pkg/cmd/status/status.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pkg/cmd/status/BUILD b/cli/pkg/cmd/status/BUILD index 247e79a125..1e6e15a3c4 100644 --- a/cli/pkg/cmd/status/BUILD +++ b/cli/pkg/cmd/status/BUILD @@ -8,7 +8,6 @@ go_library( visibility = ["//visibility:public"], deps = [ "//cli/pkg/console", - "//cli/pkg/kube", "//lib/go/httpclient", "@com_github_spf13_cobra//:cobra", "@com_github_spf13_viper//:viper", diff --git a/cli/pkg/cmd/status/status.go b/cli/pkg/cmd/status/status.go index 97bddbd8f7..a3714f96cb 100644 --- a/cli/pkg/cmd/status/status.go +++ b/cli/pkg/cmd/status/status.go @@ -21,6 +21,7 @@ var StatusCmd = &cobra.Command{ func status(cmd *cobra.Command, args []string) { c := httpclient.NewClient(viper.GetString("apihost"), viper.GetString("authToken")) + res, err := c.Config() if err != nil { From 591e3a5399abb623ebf5c38449f712ff10bd3819 Mon Sep 17 00:00:00 2001 From: ljupcovangelski Date: Wed, 3 Aug 2022 12:42:29 +0200 Subject: [PATCH 5/7] Update output message and aws docs --- docs/docs/getting-started/installation/aws.md | 141 +----------------- .../terraform/install/airy-core/main.tf | 12 +- .../terraform/install/airy-core/outputs.tf | 13 +- .../terraform/install/airy-core/variables.tf | 8 - 4 files changed, 21 insertions(+), 153 deletions(-) diff --git a/docs/docs/getting-started/installation/aws.md b/docs/docs/getting-started/installation/aws.md index 98951f8387..bd766bff6a 100644 --- a/docs/docs/getting-started/installation/aws.md +++ b/docs/docs/getting-started/installation/aws.md @@ -103,34 +103,16 @@ Now you can run this command, which will create `Airy Core` in your AWS account: airy create --provider=aws ``` -You can also use an existing VPC, without creating additional VPC resources: - -```bash -airy create --provider aws --provider-config vpcId=myExistingVpcId -``` - -By default the command creates an AWS NodeGroup with two `c5.xlarge` instances. -For customizing the instance type run: - -```bash -airy create --provider aws --provider-config instanceType=c5.large -``` - This will execute the following actions: 1. Create the `my-airy` directory and populate it with the configuration that the CLI will need. All subsequent commands need to either be run from this directory or use the `--workspace` flag. -2. Start an Airy Core cluster in your AWS account. -3. Print URLs for accessing the UIs and APIs (see recording). - -By default, the installation will create a single EC2 Kubernetes node, as part -of a single node group. You can scale your EKS cluster by adding more nodes or -node groups through the AWS web console or the AWS CLI. - -import Script from "@site/src/components/Script"; - - +2. Download two Terraform modules inside the `terraform` directory in the workspace. First module is for creating the EKS cluster, the second is for deploying `Airy Core` on that cluster. +3. Run the `install.sh` bash script inside the `terraform` directory. +4. Create an EKS cluster in your AWS account (applying the `aws-eks` state). +5. Deploy `Airy Core` in that cluster (applying the `airy-core` state). +6. Print URLs for accessing the UI and API. If you want to customize your `Airy Core` instance please see our [Configuration Section](configuration.md). @@ -138,14 +120,14 @@ Section](configuration.md). After the installation, you can also interact with the components of `Airy Core` with the [kubectl](https://kubernetes.io/docs/tasks/tools/) command line utility. You can find the kubeconfig of your Airy Core instance in -`~/.airy/kube.conf`. +`WORKSPACE/terraform/kube.conf`. ### Verification After the installation process, you can verify that all the pods are running with ``` -kubectl get pods --kubeconfig ./kube.conf +kubectl get pods --kubeconfig .terraform/kube.conf ``` ### Common issues @@ -320,111 +302,4 @@ For more details please see our [Configuration Section](configuration.md). ## Uninstall Airy Core -You can remove the Airy Core AWS installation by deleting the Airy Core AWS resources with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html). - -Retrieve the ID of the installation, in this case `my-airy` is the name of the installation that was passed on the creation process: - -```sh -cd my-airy -id=$(cat cli.yaml | grep contextname | awk '{ print $2; }') -echo ${id} -``` - -Make sure that the ID was printed back to you, before proceeding with the deletion of the resources. - -Delete the EKS nodegroup: - -```sh -node_group_name=$(aws eks list-nodegroups --cluster-name ${id} --query 'nodegroups[0]' --output text) -aws eks delete-nodegroup --nodegroup-name $node_group_name --cluster-name ${id} -``` - -Delete the EKS cluster: - -```sh -while ! aws eks delete-cluster --name ${id} -do - echo "Waiting for EKS nodegroup to be deleted..." - sleep 15 -done -``` - -Delete the created IAM Role: - -```sh -for policy in $(aws iam list-attached-role-policies --role-name ${id} --query 'AttachedPolicies[].PolicyArn' --output text) -do - aws iam detach-role-policy --policy-arn ${policy} --role-name ${id} -done -aws iam delete-role --role-name ${id} -``` - -If you used an existing VPC, then you already removed `Airy Core` from your infrastructure and there is no need to run any additional commands. -If not, you can proceed with removing all the VPC resources, created exclusively for `Airy Core`. - -Get the ID of the VPC: - -```sh -vpc_id=$(aws ec2 describe-vpcs --filters Name=tag:Name,Values=${id} --query 'Vpcs[0].VpcId' --output text) -``` - -Delete all the load-balancers: - -```sh -for loadbalancer in $(aws elb describe-load-balancers --query "LoadBalancerDescriptions[?VPCId=='${vpc_id}'].LoadBalancerName" --output text) -do - aws elb delete-load-balancer --load-balancer-name ${loadbalancer} -done -``` - -Delete all used network interfaces (iIf the command fails, check if all the `loadbalancers` are deleted and run the previous command one more time): - -```sh -for interface in $(aws ec2 describe-network-interfaces --filters Name=vpc-id,Values=${vpc_id} --query 'NetworkInterfaces[].NetworkInterfaceId' --output text) -do - aws ec2 delete-network-interface --network-interface-id ${interface} -done -``` - -Delete the security groups created by the load-balancers: - -```sh -for group in $(aws ec2 describe-security-groups --filters Name=vpc-id,Values=${vpc_id} --filters Name=tag-key,Values=kubernetes.io/cluster/${id} --query 'SecurityGroups[].GroupId' --output text) -do - aws ec2 delete-security-group --group-id ${group} -done -``` - -Delete all the subnets in the VPC: - -```sh -for subnet in $(aws ec2 describe-subnets --filters Name=vpc-id,Values=${vpc_id} --query 'Subnets[].SubnetId' --output text) -do - aws ec2 delete-subnet --subnet-id ${subnet} -done -``` - -Delete the gateways and the routes in the VPC: - -```sh -for gateway in $(aws ec2 describe-internet-gateways --filters Name=attachment.vpc-id,Values=${vpc_id} --query 'InternetGateways[].InternetGatewayId' --output text) -do - aws ec2 detach-internet-gateway --internet-gateway-id ${gateway} --vpc-id ${vpc_id} - aws ec2 delete-internet-gateway --internet-gateway-id ${gateway} -done -``` - -Delete the route tables (the command will always fail for the default route table, but you can still delete the VPC in the next step): - -```sh -for route_table in $(aws ec2 describe-route-tables --filters Name=vpc-id,Values=${vpc_id} --query 'RouteTables[].RouteTableId' --output text) -do - aws ec2 delete-route-table --route-table-id ${route_table} -done -``` - -At the end, delete the VPC: - -```sh -aws ec2 delete-vpc --vpc-id ${vpc_id} -``` +To uninstall `Airy Core` from AWS, run the `uninstall.sh` script located in the `WORKSPACE/terraform` directory. This script will run `terraform destroy` on both the `kubernetes` (EKS) and the `airy-core` state. diff --git a/infrastructure/terraform/install/airy-core/main.tf b/infrastructure/terraform/install/airy-core/main.tf index c39172b814..a12865c304 100644 --- a/infrastructure/terraform/install/airy-core/main.tf +++ b/infrastructure/terraform/install/airy-core/main.tf @@ -18,15 +18,11 @@ provider "kubernetes" { module "my_airy_core" { source = "github.com/airyhq/airy.git/infrastructure/terraform/modules/core" - values_yaml = data.template_file.airy_yaml.rendered + values_yaml = file("${var.airy_workspace}/airy.yaml") resources_yaml = file("${path.module}/files/defaultResourceLimits.yaml") } -data "template_file" "airy_yaml" { - template = file("${var.airy_workspace}/airy.yaml") - - vars = { - host = var.host - hosted_zone = var.hosted_zone - } +resource "local_file" "cli_yaml" { + filename = "${var.airy_workspace}/cli.yaml" + content = "apihost: http://${module.airy_core.loadbalancer}\n" } diff --git a/infrastructure/terraform/install/airy-core/outputs.tf b/infrastructure/terraform/install/airy-core/outputs.tf index 66f4adad5c..7480452749 100644 --- a/infrastructure/terraform/install/airy-core/outputs.tf +++ b/infrastructure/terraform/install/airy-core/outputs.tf @@ -1,4 +1,9 @@ -output "loadbalancer" { - description = "The URL for the load balancer of the cluster. Used to access the UI via the browser" - value = module.my_airy_core.loadbalancer -} \ No newline at end of file +output "API" { + description = "The URL where the API and the UI can be reached" + value = module.airy_core.loadbalancer +} + +output "Info" { + description = "More information" + value = "For more information about the AWS provider visit https://airy.co/docs/core/getting-started/installation/aws" +} diff --git a/infrastructure/terraform/install/airy-core/variables.tf b/infrastructure/terraform/install/airy-core/variables.tf index 41d8e493d9..14bcec609f 100644 --- a/infrastructure/terraform/install/airy-core/variables.tf +++ b/infrastructure/terraform/install/airy-core/variables.tf @@ -3,14 +3,6 @@ variable "core_id" { description = "The name of the cluster " } -variable "host" { - default = "" -} - -variable "hosted_zone" { - default = "airy.co" -} - variable "airy_workspace" { type = string default = "../.." From b9b115c7e450dc74fd0d503cd87114c44956a242 Mon Sep 17 00:00:00 2001 From: ljupcovangelski Date: Wed, 3 Aug 2022 15:05:36 +0200 Subject: [PATCH 6/7] Update aws docs --- docs/docs/getting-started/installation/aws.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/docs/getting-started/installation/aws.md b/docs/docs/getting-started/installation/aws.md index bd766bff6a..71c2de73e6 100644 --- a/docs/docs/getting-started/installation/aws.md +++ b/docs/docs/getting-started/installation/aws.md @@ -105,14 +105,11 @@ airy create --provider=aws This will execute the following actions: -1. Create the `my-airy` directory and populate it with the configuration that - the CLI will need. All subsequent commands need to either be run from this - directory or use the `--workspace` flag. -2. Download two Terraform modules inside the `terraform` directory in the workspace. First module is for creating the EKS cluster, the second is for deploying `Airy Core` on that cluster. -3. Run the `install.sh` bash script inside the `terraform` directory. -4. Create an EKS cluster in your AWS account (applying the `aws-eks` state). -5. Deploy `Airy Core` in that cluster (applying the `airy-core` state). -6. Print URLs for accessing the UI and API. +1. Download two Terraform modules inside the `terraform` directory in the workspace. First module is for creating the EKS cluster, the second is for deploying `Airy Core` on that cluster. +2. Run the `install.sh` bash script inside the `terraform` directory. +3. Create an EKS cluster in your AWS account (applying the `aws-eks` state). +4. Deploy `Airy Core` in that cluster (applying the `airy-core` state). +5. Print URLs for accessing the UI and API. If you want to customize your `Airy Core` instance please see our [Configuration Section](configuration.md). From 6d2b2ef22d11acc97adac446cb0fe9ddb34319df Mon Sep 17 00:00:00 2001 From: ljupcovangelski Date: Wed, 3 Aug 2022 16:11:01 +0200 Subject: [PATCH 7/7] Clarify aws docs --- docs/docs/getting-started/installation/aws.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/getting-started/installation/aws.md b/docs/docs/getting-started/installation/aws.md index 71c2de73e6..42903b2118 100644 --- a/docs/docs/getting-started/installation/aws.md +++ b/docs/docs/getting-started/installation/aws.md @@ -97,7 +97,7 @@ If you want to use Airy Core with auto-generated HTTPS certificates, refer to th ::: -Now you can run this command, which will create `Airy Core` in your AWS account: +Now you can run the following command in your Airy workspace, which will create a Kubernetes cluster with `Airy Core` in your AWS account: ```bash airy create --provider=aws