diff --git a/go.mod b/go.mod index 444fca441..0044e5efd 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module github.com/cloudfoundry/staticfile-buildpack require ( - github.com/Dynatrace/libbuildpack-dynatrace v1.2.2 + github.com/Dynatrace/libbuildpack-dynatrace v1.3.0 github.com/blang/semver v3.5.1+incompatible - github.com/cloudfoundry/libbuildpack v0.0.0-20200909214455-d0fec925f78c + github.com/cloudfoundry/libbuildpack v0.0.0-20200909214906-b55acfb6608b github.com/golang/mock v1.4.4 github.com/kardolus/httpmock v0.0.0-20181110092731-53def6cd0f87 github.com/onsi/ginkgo v1.14.1 - github.com/onsi/gomega v1.10.1 + github.com/onsi/gomega v1.10.2 github.com/tidwall/gjson v1.6.1 golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 // indirect ) diff --git a/go.sum b/go.sum index 380edccdf..ee5251d48 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ code.cloudfoundry.org/lager v2.0.0+incompatible/go.mod h1:O2sS7gKP3HM2iemG+Enwvy github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Dynatrace/libbuildpack-dynatrace v1.2.2 h1:5mDdE4U0FjX11TsCghqD/iAXDgebuKpz9WRZw52oiqg= github.com/Dynatrace/libbuildpack-dynatrace v1.2.2/go.mod h1:TojYXsxk1r+TaVOTUOWKyX2hAOzbvb+BsQGxUZ8Cb2s= +github.com/Dynatrace/libbuildpack-dynatrace v1.3.0 h1:Gr3npoRtYUe4U+4V2vwAW1TiEcFckMHeYlkguVSnnCU= +github.com/Dynatrace/libbuildpack-dynatrace v1.3.0/go.mod h1:TojYXsxk1r+TaVOTUOWKyX2hAOzbvb+BsQGxUZ8Cb2s= github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= @@ -14,6 +16,8 @@ github.com/cheggaaa/pb/v3 v3.0.5/go.mod h1:X1L61/+36nz9bjIsrDU52qHKOQukUQe2Ge+Yv github.com/cloudfoundry/libbuildpack v0.0.0-20181224210246-78d931650f60/go.mod h1:KeoPc96Iq+nQVhfgjoVN3tNHT0P2NjGCYzCezJi5OW4= github.com/cloudfoundry/libbuildpack v0.0.0-20200909214455-d0fec925f78c h1:ffzuKucEXhbwMd/1oNMmFtolkxO0we1Lb1A45Q4B5q0= github.com/cloudfoundry/libbuildpack v0.0.0-20200909214455-d0fec925f78c/go.mod h1:GmC0nBA7h7JT09bCq2lUzY2+ysPGMVJIVZWOI3FAeUY= +github.com/cloudfoundry/libbuildpack v0.0.0-20200909214906-b55acfb6608b h1:ZqXFsYZ39haR326rHE2OeJIQWTywWWu3GtG7d7SkWms= +github.com/cloudfoundry/libbuildpack v0.0.0-20200909214906-b55acfb6608b/go.mod h1:XqRse3DRnh0HiCp2Nfab69X9sLMlfxXYqx5lFQVkCMU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -79,6 +83,8 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= +github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/paketo-buildpacks/packit v0.2.7 h1:KYv4MBU4JnTDE3P5udCskjQFbh668Gbxa6Bbe/582Uc= github.com/paketo-buildpacks/packit v0.2.7/go.mod h1:DO2CSp/uF+cn+9pk2zE+Y7ZpA99PPi/pBNYc2p4ZRjk= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= diff --git a/vendor/github.com/Dynatrace/libbuildpack-dynatrace/hook.go b/vendor/github.com/Dynatrace/libbuildpack-dynatrace/hook.go index 342b3eeb9..7e79e45b7 100644 --- a/vendor/github.com/Dynatrace/libbuildpack-dynatrace/hook.go +++ b/vendor/github.com/Dynatrace/libbuildpack-dynatrace/hook.go @@ -26,6 +26,7 @@ type Command interface { type credentials struct { ServiceName string EnvironmentID string + CustomOneAgentURL string APIToken string APIURL string SkipErrors bool @@ -211,11 +212,12 @@ func (h *Hook) getCredentials() *credentials { EnvironmentID: queryString("environmentid"), APIToken: queryString("apitoken"), APIURL: queryString("apiurl"), + CustomOneAgentURL: queryString("customoneagenturl"), SkipErrors: queryString("skiperrors") == "true", NetworkZone: queryString("networkzone"), } - if creds.EnvironmentID != "" && creds.APIToken != "" { + if (creds.EnvironmentID != "" && creds.APIToken != "") || creds.CustomOneAgentURL != "" { found = append(found, creds) } else if !(creds.EnvironmentID == "" && creds.APIToken == "") { // One of the fields is empty. h.Log.Warning("Incomplete credentials for service: %s, environment ID: %s, API token: %s", creds.ServiceName, @@ -242,8 +244,10 @@ func (h *Hook) download(url, filePath string, buildPackVersion string, language client := &http.Client{} req, _ := http.NewRequest("GET", url, nil) - req.Header.Set("User-Agent", fmt.Sprintf("cf-%s-buildpack/%s", language, buildPackVersion)) - req.Header.Set("Authorization", fmt.Sprintf("Api-Token %s", creds.APIToken)) + if creds.CustomOneAgentURL == "" { + req.Header.Set("User-Agent", fmt.Sprintf("cf-%s-buildpack/%s", language, buildPackVersion)) + req.Header.Set("Authorization", fmt.Sprintf("Api-Token %s", creds.APIToken)) + } out, err := os.Create(filePath) if err != nil { @@ -298,6 +302,10 @@ func (h *Hook) download(url, filePath string, buildPackVersion string, language } func (h *Hook) getDownloadURL(c *credentials) string { + if c.CustomOneAgentURL != "" { + return c.CustomOneAgentURL + } + apiURL := c.APIURL if apiURL == "" { apiURL = fmt.Sprintf("https://%s.live.dynatrace.com/api", c.EnvironmentID) diff --git a/vendor/github.com/cloudfoundry/libbuildpack/go.mod b/vendor/github.com/cloudfoundry/libbuildpack/go.mod index 33a4fabd2..760a7dd3f 100644 --- a/vendor/github.com/cloudfoundry/libbuildpack/go.mod +++ b/vendor/github.com/cloudfoundry/libbuildpack/go.mod @@ -10,8 +10,8 @@ require ( github.com/golang/mock v1.4.4 github.com/google/subcommands v1.2.0 github.com/jarcoal/httpmock v1.0.6 - github.com/onsi/ginkgo v1.14.0 - github.com/onsi/gomega v1.10.1 + github.com/onsi/ginkgo v1.14.1 + github.com/onsi/gomega v1.10.2 github.com/paketo-buildpacks/packit v0.2.7 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.4.0 // indirect diff --git a/vendor/github.com/cloudfoundry/libbuildpack/go.sum b/vendor/github.com/cloudfoundry/libbuildpack/go.sum index 28c9c3bb0..cb79f5760 100644 --- a/vendor/github.com/cloudfoundry/libbuildpack/go.sum +++ b/vendor/github.com/cloudfoundry/libbuildpack/go.sum @@ -80,11 +80,15 @@ github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= +github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.0 h1:Gwkk+PTu/nfOwNMtUB/mRUv0X7ewW5dO4AERT1ThVKo= github.com/onsi/gomega v1.10.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= +github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/paketo-buildpacks/packit v0.0.9 h1:FO2m6ONZYhMJNWw3DtNSpO6qzLeQE3fyFczlhZSf4vU= github.com/paketo-buildpacks/packit v0.0.9/go.mod h1:S2ud8PcMgCjnOjIYnlituwDFL12uQ9eWy9qjTHlM/IM= github.com/paketo-buildpacks/packit v0.0.10 h1:W29he2huZn6UcSWO6nMgBUQlLBUi4pCrQS+VXcCfYBQ= diff --git a/vendor/github.com/onsi/gomega/CHANGELOG.md b/vendor/github.com/onsi/gomega/CHANGELOG.md index 3aafdbcfc..0b6c2fb61 100644 --- a/vendor/github.com/onsi/gomega/CHANGELOG.md +++ b/vendor/github.com/onsi/gomega/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.10.2 + +### Fixes +- Add ExpectWithOffset, EventuallyWithOffset and ConsistentlyWithOffset to WithT (#391) [990941a] + ## 1.10.1 ### Fixes diff --git a/vendor/github.com/onsi/gomega/gomega_dsl.go b/vendor/github.com/onsi/gomega/gomega_dsl.go index 8ff9611d5..b416d20cc 100644 --- a/vendor/github.com/onsi/gomega/gomega_dsl.go +++ b/vendor/github.com/onsi/gomega/gomega_dsl.go @@ -24,7 +24,7 @@ import ( "github.com/onsi/gomega/types" ) -const GOMEGA_VERSION = "1.10.1" +const GOMEGA_VERSION = "1.10.2" const nilFailHandlerPanic = `You are trying to make an assertion, but Gomega's fail handler is nil. If you're using Ginkgo then you probably forgot to put your assertion in an It(). @@ -376,13 +376,13 @@ func NewGomegaWithT(t types.GomegaTestingT) *GomegaWithT { return NewWithT(t) } -// Expect is used to make assertions. See documentation for Expect. -func (g *WithT) Expect(actual interface{}, extra ...interface{}) Assertion { - return assertion.New(actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), 0, extra...) +// ExpectWithOffset is used to make assertions. See documentation for ExpectWithOffset. +func (g *WithT) ExpectWithOffset(offset int, actual interface{}, extra ...interface{}) Assertion { + return assertion.New(actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), offset, extra...) } -// Eventually is used to make asynchronous assertions. See documentation for Eventually. -func (g *WithT) Eventually(actual interface{}, intervals ...interface{}) AsyncAssertion { +// EventuallyWithOffset is used to make asynchronous assertions. See documentation for EventuallyWithOffset. +func (g *WithT) EventuallyWithOffset(offset int, actual interface{}, intervals ...interface{}) AsyncAssertion { timeoutInterval := defaultEventuallyTimeout pollingInterval := defaultEventuallyPollingInterval if len(intervals) > 0 { @@ -391,11 +391,11 @@ func (g *WithT) Eventually(actual interface{}, intervals ...interface{}) AsyncAs if len(intervals) > 1 { pollingInterval = toDuration(intervals[1]) } - return asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), timeoutInterval, pollingInterval, 0) + return asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), timeoutInterval, pollingInterval, offset) } -// Consistently is used to make asynchronous assertions. See documentation for Consistently. -func (g *WithT) Consistently(actual interface{}, intervals ...interface{}) AsyncAssertion { +// ConsistentlyWithOffset is used to make asynchronous assertions. See documentation for ConsistentlyWithOffset. +func (g *WithT) ConsistentlyWithOffset(offset int, actual interface{}, intervals ...interface{}) AsyncAssertion { timeoutInterval := defaultConsistentlyDuration pollingInterval := defaultConsistentlyPollingInterval if len(intervals) > 0 { @@ -404,7 +404,22 @@ func (g *WithT) Consistently(actual interface{}, intervals ...interface{}) Async if len(intervals) > 1 { pollingInterval = toDuration(intervals[1]) } - return asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), timeoutInterval, pollingInterval, 0) + return asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), timeoutInterval, pollingInterval, offset) +} + +// Expect is used to make assertions. See documentation for Expect. +func (g *WithT) Expect(actual interface{}, extra ...interface{}) Assertion { + return g.ExpectWithOffset(0, actual, extra...) +} + +// Eventually is used to make asynchronous assertions. See documentation for Eventually. +func (g *WithT) Eventually(actual interface{}, intervals ...interface{}) AsyncAssertion { + return g.EventuallyWithOffset(0, actual, intervals...) +} + +// Consistently is used to make asynchronous assertions. See documentation for Consistently. +func (g *WithT) Consistently(actual interface{}, intervals ...interface{}) AsyncAssertion { + return g.ConsistentlyWithOffset(0, actual, intervals...) } func toDuration(input interface{}) time.Duration { diff --git a/vendor/modules.txt b/vendor/modules.txt index fd102b76c..c60c1dda7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,12 +1,12 @@ # code.cloudfoundry.org/lager v2.0.0+incompatible code.cloudfoundry.org/lager -# github.com/Dynatrace/libbuildpack-dynatrace v1.2.2 +# github.com/Dynatrace/libbuildpack-dynatrace v1.3.0 github.com/Dynatrace/libbuildpack-dynatrace # github.com/Masterminds/semver v1.5.0 github.com/Masterminds/semver # github.com/blang/semver v3.5.1+incompatible github.com/blang/semver -# github.com/cloudfoundry/libbuildpack v0.0.0-20200909214455-d0fec925f78c +# github.com/cloudfoundry/libbuildpack v0.0.0-20200909214906-b55acfb6608b github.com/cloudfoundry/libbuildpack github.com/cloudfoundry/libbuildpack/ansicleaner github.com/cloudfoundry/libbuildpack/bratshelper @@ -48,7 +48,7 @@ github.com/onsi/ginkgo/reporters/stenographer github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty github.com/onsi/ginkgo/types -# github.com/onsi/gomega v1.10.1 +# github.com/onsi/gomega v1.10.2 github.com/onsi/gomega github.com/onsi/gomega/format github.com/onsi/gomega/internal/assertion