diff --git a/.travis.yml b/.travis.yml index 3377749bf..74119a5f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: go go: - - '1.12' + - '1.13' stages: - testlint - testds diff --git a/cloudfoundry/managers/appdeployers/bluegreenv2_strategy.go b/cloudfoundry/managers/appdeployers/bluegreenv2_strategy.go index 95b212566..2c296da00 100644 --- a/cloudfoundry/managers/appdeployers/bluegreenv2_strategy.go +++ b/cloudfoundry/managers/appdeployers/bluegreenv2_strategy.go @@ -129,6 +129,9 @@ func (s BlueGreenV2) Restage(appDeploy AppDeploy) (AppDeployResponse, error) { }, { Forward: func(ctx Context) (Context, error) { + if appDeploy.App.DockerImage != "" { + return ctx, nil + } appResp := ctx["app_response"].(AppDeployResponse) err := s.bitsManager.CopyApp(appDeploy.App.GUID, appResp.App.GUID) return ctx, err diff --git a/cloudfoundry/managers/config.go b/cloudfoundry/managers/config.go index cda64af3e..17b2a4e59 100644 --- a/cloudfoundry/managers/config.go +++ b/cloudfoundry/managers/config.go @@ -5,6 +5,7 @@ type Config struct { Endpoint string User string Password string + SSOPasscode string CFClientID string CFClientSecret string UaaClientID string @@ -13,4 +14,5 @@ type Config struct { AppLogsMax int PurgeWhenDelete bool DefaultQuotaName string + StoreTokensPath string } diff --git a/cloudfoundry/managers/session.go b/cloudfoundry/managers/session.go index 8c37d604f..b5ff4604d 100644 --- a/cloudfoundry/managers/session.go +++ b/cloudfoundry/managers/session.go @@ -1,6 +1,16 @@ package managers import ( + "crypto/tls" + "encoding/json" + "fmt" + "io/ioutil" + "net" + "net/http" + "os" + "strings" + "time" + "code.cloudfoundry.org/cfnetworking-cli-api/cfnetworking/cfnetv1" netWrapper "code.cloudfoundry.org/cfnetworking-cli-api/cfnetworking/wrapper" "code.cloudfoundry.org/cli/api/cloudcontroller/ccv2" @@ -14,17 +24,10 @@ import ( uaaWrapper "code.cloudfoundry.org/cli/api/uaa/wrapper" "code.cloudfoundry.org/cli/command/translatableerror" "code.cloudfoundry.org/cli/util/configv3" - "crypto/tls" - "fmt" "github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers/appdeployers" "github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers/bits" "github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers/noaa" "github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers/raw" - "net" - "net/http" - "os" - "strings" - "time" ) // Session - wraps the available clients from CF cli @@ -66,6 +69,15 @@ type Session struct { ApiEndpoint string } +type CFTokens struct { + AccessToken string `json:"access_token"` + RefreshToken string `json:"refresh_token"` +} + +func (t CFTokens) IsSet() bool { + return t.AccessToken != "" +} + // NewSession - func NewSession(c Config) (s *Session, err error) { if c.User == "" && c.CFClientID == "" { @@ -197,30 +209,50 @@ func (s *Session) init(config *configv3.Config, configUaa *configv3.Config, conf } // ------------------------- - // try connecting with pair given on uaa to retrieve access token and refresh token + // Obtain access and refresh tokens var accessToken string var refreshToken string - if config.CFUsername() != "" { + var errType string + + tokFromStore := s.loadTokFromStoreIfNeed(configSess.StoreTokensPath, uaaClient.RefreshAccessToken) + if tokFromStore.IsSet() { + accessToken = tokFromStore.AccessToken + refreshToken = tokFromStore.RefreshToken + } else if configSess.SSOPasscode != "" { + // try connecting with SSO passcode to retrieve access token and refresh token + accessToken, refreshToken, err = uaaClient.Authenticate(map[string]string{ + "passcode": configSess.SSOPasscode, + }, "", constant.GrantTypePassword) + errType = "SSO passcode" + } else if config.CFUsername() != "" { + // try connecting with pair given on uaa to retrieve access token and refresh token accessToken, refreshToken, err = uaaClient.Authenticate(map[string]string{ "username": config.CFUsername(), "password": config.CFPassword(), }, "", constant.GrantTypePassword) + errType = "username/password" } else if config.UAAOAuthClient() != "cf" { accessToken, refreshToken, err = uaaClient.Authenticate(map[string]string{ "client_id": config.UAAOAuthClient(), "client_secret": config.UAAOAuthClientSecret(), }, "", constant.GrantTypeClientCredentials) + errType = "client_id/client_secret" } if err != nil { - return fmt.Errorf("Error when authenticate on cf: %s", err) + return fmt.Errorf("Error when authenticate on cf using %s: %s", errType, err) } if accessToken == "" { - return fmt.Errorf("A pair of username/password or a pair of client_id/client_secret muste be set.") + return fmt.Errorf("A pair of username/password, a pair of client_id/client_secret, or a SSO passcode must be set.") } config.SetAccessToken(fmt.Sprintf("bearer %s", accessToken)) config.SetRefreshToken(refreshToken) + // Write access and refresh tokens to file if needed + err = s.saveTokToStoreIfNeed(configSess.StoreTokensPath, accessToken, refreshToken) + if err != nil { + return fmt.Errorf("Error when trying to save tokens to %s: %s", configSess.StoreTokensPath, err.Error()) + } // ------------------------- // assign uaa client to request wrappers uaaAuthWrapper.SetClient(uaaClient) @@ -249,10 +281,8 @@ func (s *Session) init(config *configv3.Config, configUaa *configv3.Config, conf var accessTokenSess string var refreshTokenSess string if configUaa.UAAOAuthClient() == "cf" { - accessTokenSess, refreshTokenSess, err = uaaClientSess.Authenticate(map[string]string{ - "username": config.CFUsername(), - "password": config.CFPassword(), - }, "", constant.GrantTypePassword) + accessTokenSess = accessToken + refreshTokenSess = refreshToken } else { accessTokenSess, refreshTokenSess, err = uaaClientSess.Authenticate(map[string]string{ "client_id": configUaa.UAAOAuthClient(), @@ -261,10 +291,10 @@ func (s *Session) init(config *configv3.Config, configUaa *configv3.Config, conf } if err != nil { - return fmt.Errorf("Error when authenticate on uaa: %s", err) + return fmt.Errorf("Error when authenticate on uaa [%s]: %s", configUaa.UAAOAuthClient(), err) } if accessTokenSess == "" { - return fmt.Errorf("A pair of pair of uaa_client_id/uaa_client_secret muste be set.") + return fmt.Errorf("A pair of pair of uaa_client_id/uaa_client_secret must be set.") } configUaa.SetAccessToken(fmt.Sprintf("bearer %s", accessTokenSess)) configUaa.SetRefreshToken(refreshTokenSess) @@ -376,6 +406,40 @@ func (s *Session) loadDefaultQuotaGuid(quotaName string) error { return nil } +func (s *Session) loadTokFromStoreIfNeed(storePath string, refresher func(refreshToken string) (uaa.RefreshedTokens, error)) CFTokens { + if storePath == "" { + return CFTokens{} + } + b, err := ioutil.ReadFile(storePath) + if err != nil { + return CFTokens{} + } + var tokens CFTokens + err = json.Unmarshal(b, &tokens) + if err != nil { + return CFTokens{} + } + refreshed, err := refresher(tokens.RefreshToken) + if err != nil { + return CFTokens{} + } + return CFTokens{ + AccessToken: refreshed.AccessToken, + RefreshToken: refreshed.RefreshToken, + } +} + +func (s *Session) saveTokToStoreIfNeed(storePath, accessToken, refreshToken string) error { + if storePath == "" { + return nil + } + b, _ := json.MarshalIndent(CFTokens{ + AccessToken: accessToken, + RefreshToken: refreshToken, + }, "", " ") + return ioutil.WriteFile(storePath, b, 0644) +} + // IsDefaultGroup - func (s *Session) DefaultQuotaGuid() string { return s.defaultQuotaGuid diff --git a/cloudfoundry/provider.go b/cloudfoundry/provider.go index 1a06d1ab4..9519bf458 100644 --- a/cloudfoundry/provider.go +++ b/cloudfoundry/provider.go @@ -28,6 +28,11 @@ func Provider() terraform.ResourceProvider { Optional: true, DefaultFunc: schema.EnvDefaultFunc("CF_PASSWORD", ""), }, + "sso_passcode": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + DefaultFunc: schema.EnvDefaultFunc("CF_SSO_PASSCODE", ""), + }, "cf_client_id": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -71,6 +76,12 @@ func Provider() terraform.ResourceProvider { DefaultFunc: schema.EnvDefaultFunc("CF_PURGE_WHEN_DELETE", false), Description: "Set to true to purge when deleting a resource (e.g.: service instance, service broker)", }, + "store_tokens_path": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + DefaultFunc: schema.EnvDefaultFunc("CF_STORE_TOKENS_PATH", ""), + Description: "Path to a file to store tokens used for login. (this is useful for sso, this avoid requiring each time sso passcode)", + }, }, DataSourcesMap: map[string]*schema.Resource{ @@ -129,6 +140,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { Endpoint: strings.TrimSuffix(d.Get("api_url").(string), "/"), User: d.Get("user").(string), Password: d.Get("password").(string), + SSOPasscode: d.Get("sso_passcode").(string), CFClientID: d.Get("cf_client_id").(string), CFClientSecret: d.Get("cf_client_secret").(string), UaaClientID: d.Get("uaa_client_id").(string), @@ -136,6 +148,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { SkipSslValidation: d.Get("skip_ssl_validation").(bool), AppLogsMax: d.Get("app_logs_max").(int), DefaultQuotaName: d.Get("default_quota_name").(string), + StoreTokensPath: d.Get("store_tokens_path").(string), } return managers.NewSession(c) } diff --git a/cloudfoundry/resource_cf_app.go b/cloudfoundry/resource_cf_app.go index 173c3dc25..ee4561f36 100644 --- a/cloudfoundry/resource_cf_app.go +++ b/cloudfoundry/resource_cf_app.go @@ -1,18 +1,19 @@ package cloudfoundry import ( - "code.cloudfoundry.org/cli/api/cloudcontroller/ccv2" - "code.cloudfoundry.org/cli/api/cloudcontroller/ccv2/constant" "encoding/json" "fmt" - "github.com/hashicorp/terraform/helper/hashcode" - "github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers" - "github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers/appdeployers" "log" "reflect" "strings" "time" + "code.cloudfoundry.org/cli/api/cloudcontroller/ccv2" + "code.cloudfoundry.org/cli/api/cloudcontroller/ccv2/constant" + "github.com/hashicorp/terraform/helper/hashcode" + "github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers" + "github.com/terraform-providers/terraform-provider-cloudfoundry/cloudfoundry/managers/appdeployers" + "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" ) @@ -444,8 +445,12 @@ func resourceAppUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange("enable_ssh") { appUpdate.EnableSSH = BoolToNullBool(d.Get("enable_ssh").(bool)) } - if d.HasChange("stopped") && !d.Get("stopped").(bool) { - appUpdate.State = constant.ApplicationStopped + if d.HasChange("stopped") { + state := constant.ApplicationStarted + if d.Get("stopped").(bool) { + state = constant.ApplicationStopped + } + appUpdate.State = state } if d.HasChange("docker_image") { appUpdate.DockerImage = d.Get("docker_image").(string) diff --git a/docs/index.md b/docs/index.md index 55aad8f08..52f92d7d2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -50,6 +50,9 @@ The following arguments are supported: * `password` - (Optional) Cloud Foundry user's password. This can also be specified with the `CF_PASSWORD` shell environment variable. +* `sso_passcode` - (Optional) A passcode provided by UAA single sign on. The equivalent of `cf login --sso-passcode`. This can also be specified + with the `CF_SSO_PASSCODE` shell environment variable. + * `cf_client_id` - (Optional) The cf client ID to make request with a client instead of user. This can also be specified with the `CF_CLIENT_ID` shell environment variable. @@ -73,3 +76,6 @@ The following arguments are supported: * `purge_when_delete` - (Optional) Set to true to purge when deleting a resource (e.g.: service instance, service broker) . This can also be specified with the `CF_PURGE_WHEN_DELETE` shell environment variable. + +* `store_tokens_path` - (Optional) Path to a file to store tokens used for login. (this is useful for sso, this avoid + requiring each time sso passcode) . This can also be specified with the `CF_STORE_TOKENS_PATH` shell environment variable. \ No newline at end of file diff --git a/go.mod b/go.mod index 51f8df93e..7aeeeb4f3 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/terraform-providers/terraform-provider-cloudfoundry -go 1.12 +go 1.13 -replace code.cloudfoundry.org/cli => github.com/cloudfoundry-community/cloudfoundry-cli v0.0.1-complete-api +replace code.cloudfoundry.org/cli => github.com/cloudfoundry-community/cloudfoundry-cli v0.0.2-complete-api require ( code.cloudfoundry.org/bytefmt v0.0.0-20180906201452-2aa6f33b730c // indirect @@ -34,19 +34,10 @@ require ( github.com/hashicorp/terraform v0.12.0 github.com/lunixbochs/vtclean v1.0.0 // indirect github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 // indirect - github.com/mattn/go-colorable v0.1.4 // indirect github.com/mitchellh/reflectwalk v1.0.1 // indirect - github.com/onsi/ginkgo v1.10.1 // indirect - github.com/onsi/gomega v1.7.0 // indirect github.com/poy/eachers v0.0.0-20181020210610-23942921fe77 // indirect github.com/satori/go.uuid v1.2.0 github.com/sirupsen/logrus v1.4.2 // indirect - github.com/stretchr/testify v1.4.0 // indirect github.com/tedsuo/rata v1.0.0 // indirect github.com/vito/go-interact v1.0.0 // indirect - golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 // indirect - golang.org/x/net v0.0.0-20190923162816-aa69164e4478 // indirect - google.golang.org/grpc v1.21.0 // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - gopkg.in/yaml.v2 v2.2.4 // indirect ) diff --git a/go.sum b/go.sum index cafd425a6..6ce1b03f1 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20161106042343-c914be64f07d/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudfoundry-community/cloudfoundry-cli v0.0.1-complete-api h1:M7Fyn8+gCG347eBDV4uMNtyFSP0PFKaGqQ45Kyxx3dM= -github.com/cloudfoundry-community/cloudfoundry-cli v0.0.1-complete-api/go.mod h1:DigEBZwaNy/7RSrQpKuMeADXY5tFaWaieQX+UM8+0fA= +github.com/cloudfoundry-community/cloudfoundry-cli v0.0.2-complete-api h1:gAym75FfG1DENlKO8FQLVGB2jZ+mxYUFUU82SzzmkIA= +github.com/cloudfoundry-community/cloudfoundry-cli v0.0.2-complete-api/go.mod h1:DigEBZwaNy/7RSrQpKuMeADXY5tFaWaieQX+UM8+0fA= github.com/cloudfoundry/bosh-cli v5.5.0+incompatible h1:P+hlG8D9xXIi75yqTpFrNBHR3oMWWMPNhj5AwSN2tOU= github.com/cloudfoundry/bosh-cli v5.5.0+incompatible/go.mod h1:rzIB+e1sn7wQL/TJ54bl/FemPKRhXby5BIMS3tLuWFM= github.com/cloudfoundry/bosh-utils v0.0.0-20190518100210-9f9df32d41c3 h1:SbXvMoOwvn5r/uOx3ylQ5pDQxWPaV9dPW5kQ5VpfmUQ= @@ -151,6 +151,7 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -160,6 +161,7 @@ github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+u github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57 h1:eqyIo2HjKhKe/mJzTG8n4VqvLXIOEG+SLdDqX7xGtkY= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/googleapis/gax-go v2.0.0+incompatible h1:j0GKcs05QVmm7yesiZq2+9cxHkNK9YM6zKx4D2qucQU= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= @@ -282,8 +284,6 @@ github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0X github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -334,14 +334,10 @@ github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -411,8 +407,6 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= @@ -444,6 +438,7 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= +golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d h1:E2M5QgjZ/Jg+ObCQAudsXxuTsLj7Nl5RV/lZcQZmKSo= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20180816225734-aabede6cba87/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -455,12 +450,9 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -471,14 +463,11 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181129055619-fae4c4e3ad76/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890 h1:uESlIz09WIHT2I+pasSXcpLYqYK8wHcdCetU3VuMBJE= @@ -508,20 +497,18 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 h1:rOhMmluY6kLMhdnrivzec6lLgaVbMHMn2ISQXJeJ5EM= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -545,19 +532,16 @@ google.golang.org/grpc v1.17.0 h1:TRJYBgMclJvGYn2rIMjj+h9KtMt5r1Ij7ODVRIZkwhk= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.18.0 h1:IZl7mfBGfbhYx2p2rKRtYgDFw6SBz+kclmxYrCksPPA= google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.21.0 h1:G+97AoqBnmZIT91cLG/EkCoK9NSelj64P8bOHHNmGn0= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.27 h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= @@ -572,11 +556,8 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= diff --git a/tests/clean.sh b/tests/clean.sh index 5fcac0543..4a1b15227 100755 --- a/tests/clean.sh +++ b/tests/clean.sh @@ -10,6 +10,8 @@ if [ -z "$CF_API_URL" ] || [ -z "$CF_USER" ] || [ -z "$CF_PASSWORD" ]; then exit 1; fi +# we have no more shared platform :( +exit 0 #set -e # Exit if the login fails (not set or wrongly set!) cf api $CF_API_URL --skip-ssl-validation