From 50f670d0a2c577f6b46756670973c3f1fb17f63f Mon Sep 17 00:00:00 2001 From: CI Bot Date: Wed, 30 Oct 2024 21:57:24 +0000 Subject: [PATCH] Update vendored dependencies --- src/bosh-warden-cpi/go.mod | 12 +++---- src/bosh-warden-cpi/go.sum | 24 ++++++------- .../code.cloudfoundry.org/lager/v3/README.md | 2 +- .../bosh-cpi-go/apiv1/networks.go | 10 ++++++ .../github.com/onsi/ginkgo/v2/CHANGELOG.md | 15 ++++++++ .../onsi/ginkgo/v2/formatter/formatter.go | 4 +++ .../github.com/onsi/ginkgo/v2/types/config.go | 2 +- .../github.com/onsi/ginkgo/v2/types/types.go | 10 +++++- .../onsi/ginkgo/v2/types/version.go | 2 +- .../github.com/onsi/gomega/CHANGELOG.md | 15 ++++++++ .../github.com/onsi/gomega/gomega_dsl.go | 16 +++++++-- .../onsi/gomega/internal/async_assertion.go | 12 +++++-- .../onsi/gomega/internal/duration_bundle.go | 17 +++++---- .../github.com/onsi/gomega/internal/gomega.go | 8 +++++ .../gomega/internal/polling_signal_error.go | 11 ++++++ .../onsi/gomega/matchers/have_field.go | 36 ++++++++++++------- src/bosh-warden-cpi/vendor/modules.txt | 14 ++++---- 17 files changed, 158 insertions(+), 52 deletions(-) diff --git a/src/bosh-warden-cpi/go.mod b/src/bosh-warden-cpi/go.mod index 15ff4b8e..0047fad7 100644 --- a/src/bosh-warden-cpi/go.mod +++ b/src/bosh-warden-cpi/go.mod @@ -3,22 +3,22 @@ module bosh-warden-cpi go 1.22.0 require ( - code.cloudfoundry.org/garden v0.0.0-20241023020423-a21e43a17f84 - github.com/cloudfoundry/bosh-cpi-go v0.0.0-20241019100220-723b30380ab8 + code.cloudfoundry.org/garden v0.0.0-20241030020456-74829d0a2201 + github.com/cloudfoundry/bosh-cpi-go v0.0.0-20241030212755-0e796ef21b6f github.com/cloudfoundry/bosh-utils v0.0.500 - github.com/onsi/ginkgo/v2 v2.20.2 - github.com/onsi/gomega v1.34.2 + github.com/onsi/ginkgo/v2 v2.21.0 + github.com/onsi/gomega v1.35.0 ) require ( - code.cloudfoundry.org/lager/v3 v3.11.0 // indirect + code.cloudfoundry.org/lager/v3 v3.13.0 // indirect github.com/bmatcuk/doublestar v1.3.4 // indirect github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect github.com/charlievieth/fs v0.0.3 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/pprof v0.0.0-20241023014458-598669927662 // indirect + github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect github.com/nxadm/tail v1.4.11 // indirect github.com/openzipkin/zipkin-go v0.4.3 // indirect diff --git a/src/bosh-warden-cpi/go.sum b/src/bosh-warden-cpi/go.sum index 506d7faa..8bf2df52 100644 --- a/src/bosh-warden-cpi/go.sum +++ b/src/bosh-warden-cpi/go.sum @@ -1,15 +1,15 @@ -code.cloudfoundry.org/garden v0.0.0-20241023020423-a21e43a17f84 h1:ceT1k/IxtWDe2tNSbT7THT70MIzguBbdbuo09kTREy4= -code.cloudfoundry.org/garden v0.0.0-20241023020423-a21e43a17f84/go.mod h1:NFRJ0BR30ide5DZ2hgfjiODah9mQStc/Jx3jsMIf+ww= -code.cloudfoundry.org/lager/v3 v3.11.0 h1:YjRSl1USPIz1FFZPVvwFYgXUUodSIWDdXaLVvME3jZg= -code.cloudfoundry.org/lager/v3 v3.11.0/go.mod h1:8Ot/5fRETEzdf9U3N1kCWp00oZteNwew5Cl2Ck3t2ho= +code.cloudfoundry.org/garden v0.0.0-20241030020456-74829d0a2201 h1:Hyz6LI1KVlQ2YrzTIjYBmh8bGz3NyaNyPHqpLfGP1TM= +code.cloudfoundry.org/garden v0.0.0-20241030020456-74829d0a2201/go.mod h1:E/p9Pn1tVj1hP85ZwJHhDTpnSALq9T0nY+u540EQJ1E= +code.cloudfoundry.org/lager/v3 v3.13.0 h1:6FXwixz8K3+AKGI82tvJ1Zhl/So+tTJdkZ+EWgWVwB8= +code.cloudfoundry.org/lager/v3 v3.13.0/go.mod h1:s9leys6zsUSrlKzEPqa0/8tMdvqtERzxQYDYp+zbMng= github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0= github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f h1:gOO/tNZMjjvTKZWpY7YnXC72ULNLErRtp94LountVE8= github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/charlievieth/fs v0.0.3 h1:3lZQXTj4PbE81CVPwALSn+JoyCNXkZgORHN6h2XHGlg= github.com/charlievieth/fs v0.0.3/go.mod h1:hD4sRzto1Hw8zCua76tNVKZxaeZZr1RiKftjAJQRLLo= -github.com/cloudfoundry/bosh-cpi-go v0.0.0-20241019100220-723b30380ab8 h1:lEIXkQkkgY6mehbLc8TGDUfatexZMVJkdq7K/ekYaH4= -github.com/cloudfoundry/bosh-cpi-go v0.0.0-20241019100220-723b30380ab8/go.mod h1:YuyoDcYgTbf90Q4XKS+F2aKoJLqV7NDmgQlai84POSY= +github.com/cloudfoundry/bosh-cpi-go v0.0.0-20241030212755-0e796ef21b6f h1:hWq7YAeyR/Xt8uGqwW+X99JoyRSV3WjOZYf2TX1L20s= +github.com/cloudfoundry/bosh-cpi-go v0.0.0-20241030212755-0e796ef21b6f/go.mod h1:YuyoDcYgTbf90Q4XKS+F2aKoJLqV7NDmgQlai84POSY= github.com/cloudfoundry/bosh-utils v0.0.500 h1:am7t3jymDRE9kjwQrDY9YzlPnx6RXPQw4OPuZxaIZuE= github.com/cloudfoundry/bosh-utils v0.0.500/go.mod h1:ei4cKypTn2mHQQ2fy/tD+43YAJ/IS35h/Ao+P9iR3Xc= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -22,8 +22,8 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20241023014458-598669927662 h1:SKMkD83p7FwUqKmBsPdLHF5dNyxq3jOWwu9w9UyH5vA= -github.com/google/pprof v0.0.0-20241023014458-598669927662/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -34,10 +34,10 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= -github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= -github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= -github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= +github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= +github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/gomega v1.35.0 h1:xuM1M/UvMp9BCdS4hojhS9/4jEuVqS9Er3bqupeaoPM= +github.com/onsi/gomega v1.35.0/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/src/bosh-warden-cpi/vendor/code.cloudfoundry.org/lager/v3/README.md b/src/bosh-warden-cpi/vendor/code.cloudfoundry.org/lager/v3/README.md index 2b8facb7..568ea142 100644 --- a/src/bosh-warden-cpi/vendor/code.cloudfoundry.org/lager/v3/README.md +++ b/src/bosh-warden-cpi/vendor/code.cloudfoundry.org/lager/v3/README.md @@ -30,5 +30,5 @@ under `Diego` area. > \[!IMPORTANT\] > > Content in this file is managed by the [CI task -> `sync-readme`](https://github.com/cloudfoundry/wg-app-platform-runtime-ci/blob/c83c224ad06515ed52f51bdadf6075f56300ec93/shared/tasks/sync-readme/metadata.yml) +> `sync-readme`](https://github.com/cloudfoundry/wg-app-platform-runtime-ci/blob/main/shared/tasks/sync-readme/metadata.yml) > and is generated by CI following a convention. diff --git a/src/bosh-warden-cpi/vendor/github.com/cloudfoundry/bosh-cpi-go/apiv1/networks.go b/src/bosh-warden-cpi/vendor/github.com/cloudfoundry/bosh-cpi-go/apiv1/networks.go index b154f4ff..c1fafc86 100644 --- a/src/bosh-warden-cpi/vendor/github.com/cloudfoundry/bosh-cpi-go/apiv1/networks.go +++ b/src/bosh-warden-cpi/vendor/github.com/cloudfoundry/bosh-cpi-go/apiv1/networks.go @@ -33,6 +33,7 @@ type Network interface { IsDynamic() bool IsDefaultFor(string) bool IPWithSubnetMask() string + SubnetCIDR() string _final() // interface unimplementable from outside } @@ -192,6 +193,15 @@ func (n NetworkImpl) IsDynamic() bool { } func (n NetworkImpl) IPWithSubnetMask() string { + netmaskIP := gonet.ParseIP(n.Netmask()) + if v4 := netmaskIP.To4(); v4 != nil { + netmaskIP = v4 + } + ones, _ := gonet.IPMask(netmaskIP).Size() + return fmt.Sprintf("%s/%d", n.IP(), ones) +} + +func (n NetworkImpl) SubnetCIDR() string { netmaskIP := gonet.ParseIP(n.Netmask()) if v4 := netmaskIP.To4(); v4 != nil { netmaskIP = v4 diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md index afc55af9..3011efb5 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md @@ -1,3 +1,18 @@ +## 2.21.0 + + + ### Features + - add support for GINKGO_TIME_FORMAT [a69eb39] + - add GINKGO_NO_COLOR to disable colors via environment variables [bcab9c8] + + ### Fixes + - increase threshold in timeline matcher [e548367] + - Fix the document by replacing `SpecsThatWillBeRun` with `SpecsThatWillRun` + [c2c4d3c] + + ### Maintenance + - bump various dependencies [7e65a00] + ## 2.20.2 Require Go 1.22+ diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/formatter/formatter.go b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/formatter/formatter.go index 743555dd..4d574911 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/formatter/formatter.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/formatter/formatter.go @@ -82,6 +82,10 @@ func New(colorMode ColorMode) Formatter { return fmt.Sprintf("\x1b[38;5;%dm", colorCode) } + if _, noColor := os.LookupEnv("GINKGO_NO_COLOR"); noColor { + colorMode = ColorModeNone + } + f := Formatter{ ColorMode: colorMode, colors: map[string]string{ diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/config.go b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/config.go index 97a049e0..8c0dfab8 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/config.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/config.go @@ -328,7 +328,7 @@ var ParallelConfigFlags = GinkgoFlags{ // ReporterConfigFlags provides flags for the Ginkgo test process, and CLI var ReporterConfigFlags = GinkgoFlags{ {KeyPath: "R.NoColor", Name: "no-color", SectionKey: "output", DeprecatedName: "noColor", DeprecatedDocLink: "changed-command-line-flags", - Usage: "If set, suppress color output in default reporter."}, + Usage: "If set, suppress color output in default reporter. You can also set the environment variable GINKGO_NO_COLOR=TRUE"}, {KeyPath: "R.Verbose", Name: "v", SectionKey: "output", Usage: "If set, emits more output including GinkgoWriter contents."}, {KeyPath: "R.VeryVerbose", Name: "vv", SectionKey: "output", diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/types.go b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/types.go index aae69b04..ddcbec1b 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/types.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/types.go @@ -3,13 +3,21 @@ package types import ( "encoding/json" "fmt" + "os" "sort" "strings" "time" ) const GINKGO_FOCUS_EXIT_CODE = 197 -const GINKGO_TIME_FORMAT = "01/02/06 15:04:05.999" + +var GINKGO_TIME_FORMAT = "01/02/06 15:04:05.999" + +func init() { + if os.Getenv("GINKGO_TIME_FORMAT") != "" { + GINKGO_TIME_FORMAT = os.Getenv("GINKGO_TIME_FORMAT") + } +} // Report captures information about a Ginkgo test run type Report struct { diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/version.go b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/version.go index 6dfb25f2..caf3c9f5 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/version.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/ginkgo/v2/types/version.go @@ -1,3 +1,3 @@ package types -const VERSION = "2.20.2" +const VERSION = "2.21.0" diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/CHANGELOG.md b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/CHANGELOG.md index 7972bbc3..62523919 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/CHANGELOG.md +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/CHANGELOG.md @@ -1,3 +1,18 @@ +## 1.35.0 + +### Features + +- You can now call `EnforceDefaultTimeoutsWhenUsingContexts()` to have `Eventually` honor the default timeout when passed a context. (prior to this you had to expclility add a timeout) [e4c4265] +- You can call `StopTrying(message).Successfully()` to abort a `Consistently` early without failure [eeca931] + +### Fixes + +- Stop memoizing the result of `HaveField` to avoid unexpected errors when used with async assertions. [3bdbc4e] + +### Maintenance + +- Bump all dependencies [a05a416] + ## 1.34.2 Require Go 1.22+ diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/gomega_dsl.go b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/gomega_dsl.go index edacf8c1..b632ad3f 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/gomega_dsl.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/gomega_dsl.go @@ -22,7 +22,7 @@ import ( "github.com/onsi/gomega/types" ) -const GOMEGA_VERSION = "1.34.2" +const GOMEGA_VERSION = "1.35.0" const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler. If you're using Ginkgo then you probably forgot to put your assertion in an It(). @@ -319,7 +319,19 @@ you an also use Eventually().WithContext(ctx) to pass in the context. Passed-in Eventually(client.FetchCount).WithContext(ctx).WithArguments("/users").Should(BeNumerically(">=", 17)) }, SpecTimeout(time.Second)) -Either way the context passd to Eventually is also passed to the underlying function. Now, when Ginkgo cancels the context both the FetchCount client and Gomega will be informed and can exit. +Either way the context pasesd to Eventually is also passed to the underlying function. Now, when Ginkgo cancels the context both the FetchCount client and Gomega will be informed and can exit. + +By default, when a context is passed to Eventually *without* an explicit timeout, Gomega will rely solely on the context's cancellation to determine when to stop polling. If you want to specify a timeout in addition to the context you can do so using the .WithTimeout() method. For example: + + Eventually(client.FetchCount).WithContext(ctx).WithTimeout(10*time.Second).Should(BeNumerically(">=", 17)) + +now either the context cacnellation or the timeout will cause Eventually to stop polling. + +If, instead, you would like to opt out of this behavior and have Gomega's default timeouts govern Eventuallys that take a context you can call: + + EnforceDefaultTimeoutsWhenUsingContexts() + +in the DSL (or on a Gomega instance). Now all calls to Eventually that take a context will fail if eitehr the context is cancelled or the default timeout elapses. **Category 3: Making assertions _in_ the function passed into Eventually** diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/async_assertion.go b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/async_assertion.go index cde9e2ec..8b4cd1f5 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/async_assertion.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/async_assertion.go @@ -335,7 +335,7 @@ func (assertion *AsyncAssertion) afterTimeout() <-chan time.Time { if assertion.asyncType == AsyncAssertionTypeConsistently { return time.After(assertion.g.DurationBundle.ConsistentlyDuration) } else { - if assertion.ctx == nil { + if assertion.ctx == nil || assertion.g.DurationBundle.EnforceDefaultTimeoutsWhenUsingContexts { return time.After(assertion.g.DurationBundle.EventuallyTimeout) } else { return nil @@ -496,7 +496,15 @@ func (assertion *AsyncAssertion) match(matcher types.GomegaMatcher, desiredMatch for _, err := range []error{actualErr, matcherErr} { if pollingSignalErr, ok := AsPollingSignalError(err); ok { if pollingSignalErr.IsStopTrying() { - fail("Told to stop trying") + if pollingSignalErr.IsSuccessful() { + if assertion.asyncType == AsyncAssertionTypeEventually { + fail("Told to stop trying (and ignoring call to Successfully(), as it is only relevant with Consistently)") + } else { + return true // early escape hatch for Consistently + } + } else { + fail("Told to stop trying") + } return false } if pollingSignalErr.IsTryAgainAfter() { diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/duration_bundle.go b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/duration_bundle.go index 6e0d90d3..2e026c33 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/duration_bundle.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/duration_bundle.go @@ -8,10 +8,11 @@ import ( ) type DurationBundle struct { - EventuallyTimeout time.Duration - EventuallyPollingInterval time.Duration - ConsistentlyDuration time.Duration - ConsistentlyPollingInterval time.Duration + EventuallyTimeout time.Duration + EventuallyPollingInterval time.Duration + ConsistentlyDuration time.Duration + ConsistentlyPollingInterval time.Duration + EnforceDefaultTimeoutsWhenUsingContexts bool } const ( @@ -20,15 +21,19 @@ const ( ConsistentlyDurationEnvVarName = "GOMEGA_DEFAULT_CONSISTENTLY_DURATION" ConsistentlyPollingIntervalEnvVarName = "GOMEGA_DEFAULT_CONSISTENTLY_POLLING_INTERVAL" + + EnforceDefaultTimeoutsWhenUsingContextsEnvVarName = "GOMEGA_ENFORCE_DEFAULT_TIMEOUTS_WHEN_USING_CONTEXTS" ) func FetchDefaultDurationBundle() DurationBundle { + _, EnforceDefaultTimeoutsWhenUsingContexts := os.LookupEnv(EnforceDefaultTimeoutsWhenUsingContextsEnvVarName) return DurationBundle{ EventuallyTimeout: durationFromEnv(EventuallyTimeoutEnvVarName, time.Second), EventuallyPollingInterval: durationFromEnv(EventuallyPollingIntervalEnvVarName, 10*time.Millisecond), - ConsistentlyDuration: durationFromEnv(ConsistentlyDurationEnvVarName, 100*time.Millisecond), - ConsistentlyPollingInterval: durationFromEnv(ConsistentlyPollingIntervalEnvVarName, 10*time.Millisecond), + ConsistentlyDuration: durationFromEnv(ConsistentlyDurationEnvVarName, 100*time.Millisecond), + ConsistentlyPollingInterval: durationFromEnv(ConsistentlyPollingIntervalEnvVarName, 10*time.Millisecond), + EnforceDefaultTimeoutsWhenUsingContexts: EnforceDefaultTimeoutsWhenUsingContexts, } } diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/gomega.go b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/gomega.go index de1f4f33..c6e2fcc0 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/gomega.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/gomega.go @@ -127,3 +127,11 @@ func (g *Gomega) SetDefaultConsistentlyDuration(t time.Duration) { func (g *Gomega) SetDefaultConsistentlyPollingInterval(t time.Duration) { g.DurationBundle.ConsistentlyPollingInterval = t } + +func (g *Gomega) EnforceDefaultTimeoutsWhenUsingContexts() { + g.DurationBundle.EnforceDefaultTimeoutsWhenUsingContexts = true +} + +func (g *Gomega) DisableDefaultTimeoutsWhenUsingContext() { + g.DurationBundle.EnforceDefaultTimeoutsWhenUsingContexts = false +} diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/polling_signal_error.go b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/polling_signal_error.go index 83b04b1a..3a4f7ddd 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/polling_signal_error.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/internal/polling_signal_error.go @@ -17,6 +17,7 @@ type PollingSignalError interface { error Wrap(err error) PollingSignalError Attach(description string, obj any) PollingSignalError + Successfully() PollingSignalError Now() } @@ -45,6 +46,7 @@ type PollingSignalErrorImpl struct { wrappedErr error pollingSignalErrorType PollingSignalErrorType duration time.Duration + successful bool Attachments []PollingSignalErrorAttachment } @@ -73,6 +75,11 @@ func (s *PollingSignalErrorImpl) Unwrap() error { return s.wrappedErr } +func (s *PollingSignalErrorImpl) Successfully() PollingSignalError { + s.successful = true + return s +} + func (s *PollingSignalErrorImpl) Now() { panic(s) } @@ -81,6 +88,10 @@ func (s *PollingSignalErrorImpl) IsStopTrying() bool { return s.pollingSignalErrorType == PollingSignalErrorTypeStopTrying } +func (s *PollingSignalErrorImpl) IsSuccessful() bool { + return s.successful +} + func (s *PollingSignalErrorImpl) IsTryAgainAfter() bool { return s.pollingSignalErrorType == PollingSignalErrorTypeTryAgainAfter } diff --git a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/matchers/have_field.go b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/matchers/have_field.go index 6989f78c..8dd3f871 100644 --- a/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/matchers/have_field.go +++ b/src/bosh-warden-cpi/vendor/github.com/onsi/gomega/matchers/have_field.go @@ -17,7 +17,7 @@ func (e missingFieldError) Error() string { return string(e) } -func extractField(actual interface{}, field string, matchername string) (interface{}, error) { +func extractField(actual interface{}, field string, matchername string) (any, error) { fields := strings.SplitN(field, ".", 2) actualValue := reflect.ValueOf(actual) @@ -64,36 +64,46 @@ func extractField(actual interface{}, field string, matchername string) (interfa type HaveFieldMatcher struct { Field string Expected interface{} +} - extractedField interface{} - expectedMatcher omegaMatcher +func (matcher *HaveFieldMatcher) expectedMatcher() omegaMatcher { + var isMatcher bool + expectedMatcher, isMatcher := matcher.Expected.(omegaMatcher) + if !isMatcher { + expectedMatcher = &EqualMatcher{Expected: matcher.Expected} + } + return expectedMatcher } func (matcher *HaveFieldMatcher) Match(actual interface{}) (success bool, err error) { - matcher.extractedField, err = extractField(actual, matcher.Field, "HaveField") + extractedField, err := extractField(actual, matcher.Field, "HaveField") if err != nil { return false, err } - var isMatcher bool - matcher.expectedMatcher, isMatcher = matcher.Expected.(omegaMatcher) - if !isMatcher { - matcher.expectedMatcher = &EqualMatcher{Expected: matcher.Expected} - } - - return matcher.expectedMatcher.Match(matcher.extractedField) + return matcher.expectedMatcher().Match(extractedField) } func (matcher *HaveFieldMatcher) FailureMessage(actual interface{}) (message string) { + extractedField, err := extractField(actual, matcher.Field, "HaveField") + if err != nil { + // this really shouldn't happen + return fmt.Sprintf("Failed to extract field '%s': %s", matcher.Field, err) + } message = fmt.Sprintf("Value for field '%s' failed to satisfy matcher.\n", matcher.Field) - message += matcher.expectedMatcher.FailureMessage(matcher.extractedField) + message += matcher.expectedMatcher().FailureMessage(extractedField) return message } func (matcher *HaveFieldMatcher) NegatedFailureMessage(actual interface{}) (message string) { + extractedField, err := extractField(actual, matcher.Field, "HaveField") + if err != nil { + // this really shouldn't happen + return fmt.Sprintf("Failed to extract field '%s': %s", matcher.Field, err) + } message = fmt.Sprintf("Value for field '%s' satisfied matcher, but should not have.\n", matcher.Field) - message += matcher.expectedMatcher.NegatedFailureMessage(matcher.extractedField) + message += matcher.expectedMatcher().NegatedFailureMessage(extractedField) return message } diff --git a/src/bosh-warden-cpi/vendor/modules.txt b/src/bosh-warden-cpi/vendor/modules.txt index f318c2bf..10ccbcd4 100644 --- a/src/bosh-warden-cpi/vendor/modules.txt +++ b/src/bosh-warden-cpi/vendor/modules.txt @@ -1,4 +1,4 @@ -# code.cloudfoundry.org/garden v0.0.0-20241023020423-a21e43a17f84 +# code.cloudfoundry.org/garden v0.0.0-20241030020456-74829d0a2201 ## explicit; go 1.22.0 code.cloudfoundry.org/garden code.cloudfoundry.org/garden/client @@ -7,7 +7,7 @@ code.cloudfoundry.org/garden/client/connection/connectionfakes code.cloudfoundry.org/garden/gardenfakes code.cloudfoundry.org/garden/routes code.cloudfoundry.org/garden/transport -# code.cloudfoundry.org/lager/v3 v3.11.0 +# code.cloudfoundry.org/lager/v3 v3.13.0 ## explicit; go 1.22.0 code.cloudfoundry.org/lager/v3 code.cloudfoundry.org/lager/v3/internal/truncate @@ -20,7 +20,7 @@ github.com/bmizerany/pat # github.com/charlievieth/fs v0.0.3 ## explicit; go 1.18 github.com/charlievieth/fs -# github.com/cloudfoundry/bosh-cpi-go v0.0.0-20241019100220-723b30380ab8 +# github.com/cloudfoundry/bosh-cpi-go v0.0.0-20241030212755-0e796ef21b6f ## explicit; go 1.22.0 github.com/cloudfoundry/bosh-cpi-go/apiv1 github.com/cloudfoundry/bosh-cpi-go/rpc @@ -48,7 +48,7 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/pprof v0.0.0-20241023014458-598669927662 +# github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db ## explicit; go 1.22 github.com/google/pprof/profile # github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d @@ -56,8 +56,8 @@ github.com/google/pprof/profile github.com/nu7hatch/gouuid # github.com/nxadm/tail v1.4.11 ## explicit; go 1.13 -# github.com/onsi/ginkgo/v2 v2.20.2 -## explicit; go 1.22 +# github.com/onsi/ginkgo/v2 v2.21.0 +## explicit; go 1.22.0 github.com/onsi/ginkgo/v2 github.com/onsi/ginkgo/v2/config github.com/onsi/ginkgo/v2/formatter @@ -78,7 +78,7 @@ github.com/onsi/ginkgo/v2/internal/parallel_support github.com/onsi/ginkgo/v2/internal/testingtproxy github.com/onsi/ginkgo/v2/reporters github.com/onsi/ginkgo/v2/types -# github.com/onsi/gomega v1.34.2 +# github.com/onsi/gomega v1.35.0 ## explicit; go 1.22 github.com/onsi/gomega github.com/onsi/gomega/format