Skip to content

Commit

Permalink
Bump github.com/onmetal/controller-utils from 0.7.0 to 0.8.0 (#107)
Browse files Browse the repository at this point in the history
* Bump github.com/onmetal/controller-utils from 0.7.0 to 0.8.0

Bumps [github.com/onmetal/controller-utils](https://github.com/onmetal/controller-utils) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/onmetal/controller-utils/releases)
- [Commits](onmetal/controller-utils@v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: github.com/onmetal/controller-utils
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* refactor: refactor polling functions for improved efficiency

- Replace `PollImmediateWithContext` with `PollUntilContextTimeout` in `waitForAPIServicesOpenAPIV3` function
- Replace `PollImmediateInfiniteWithContext` with `PollUntilContextCancel` in `pollHealthCheck`, `waitUntilGVKsDiscoverable`, and `WaitUntilAPIServicesAvailable` functions in separate files

Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andreas Fritzler <andreas.fritzler@sap.com>
  • Loading branch information
dependabot[bot] and afritzler authored Jun 1, 2023
1 parent 7662cbc commit 8414784
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 425 deletions.
2 changes: 1 addition & 1 deletion cmd/openapi-extractor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func waitForAPIServicesOpenAPIV3(
})
}

if err := wait.PollImmediateWithContext(ctx, 1*time.Second, timeout, func(ctx context.Context) (done bool, err error) {
if err := wait.PollUntilContextTimeout(ctx, 1*time.Second, timeout, true, func(ctx context.Context) (done bool, err error) {
newTestGVs := sets.New[schema.GroupVersion]()
for testGV := range testGVs {
err := clientSet.RESTClient().
Expand Down
2 changes: 1 addition & 1 deletion envtestutils/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (a *APIServer) pollHealthCheck(ctx context.Context) error {
},
}

return wait.PollImmediateInfiniteWithContext(ctx, 1*time.Second, func(ctx context.Context) (done bool, err error) {
return wait.PollUntilContextCancel(ctx, 1*time.Second, true, func(ctx context.Context) (done bool, err error) {
req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("https://%s:%d/readyz", a.host, a.port), nil)
if err != nil {
return false, fmt.Errorf("error creating health request: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions envtestutils/envtestutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func WaitUntilTypesDiscoverableWithTimeout(timeout time.Duration, c client.Clien
}

func waitUntilGVKsDiscoverable(ctx context.Context, c client.Client, gvks map[schema.GroupVersionKind]struct{}) error {
if err := wait.PollImmediateInfiniteWithContext(ctx, 50*time.Millisecond, func(ctx context.Context) (done bool, err error) {
if err := wait.PollUntilContextCancel(ctx, 50*time.Millisecond, true, func(ctx context.Context) (done bool, err error) {
for gvk := range gvks {
mappings, err := c.RESTMapper().RESTMappings(gvk.GroupKind(), gvk.Version)
if err != nil {
Expand Down Expand Up @@ -484,7 +484,7 @@ func WaitUntilAPIServicesAvailable(ctx context.Context, c client.Client, service
apiServices = append(apiServices, service.DeepCopy())
}

if err := wait.PollImmediateInfiniteWithContext(ctx, 50*time.Millisecond, func(ctx context.Context) (done bool, err error) {
if err := wait.PollUntilContextCancel(ctx, 50*time.Millisecond, true, func(ctx context.Context) (done bool, err error) {
for i := len(apiServices) - 1; i >= 0; i-- {
apiService := apiServices[i]
key := client.ObjectKeyFromObject(apiService)
Expand Down
46 changes: 23 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ go 1.19
require (
github.com/go-logr/logr v1.2.4
github.com/google/addlicense v1.1.1
github.com/onmetal/controller-utils v0.7.0
github.com/onmetal/controller-utils v0.8.0
github.com/onsi/ginkgo/v2 v2.9.7
github.com/onsi/gomega v1.27.7
github.com/spf13/pflag v1.0.5
golang.org/x/sys v0.8.0
k8s.io/api v0.26.3
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.3
k8s.io/api v0.27.2
k8s.io/apimachinery v0.27.2
k8s.io/client-go v0.27.2
k8s.io/kube-aggregator v0.26.3
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
sigs.k8s.io/controller-runtime v0.14.6
k8s.io/utils v0.0.0-20230209194617-a36077c30491
sigs.k8s.io/controller-runtime v0.15.0
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bmatcuk/doublestar/v4 v4.0.2 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
Expand All @@ -38,41 +38,41 @@ require (
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/component-base v0.26.3 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
k8s.io/apiextensions-apiserver v0.27.2 // indirect
k8s.io/component-base v0.27.2 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)
Loading

0 comments on commit 8414784

Please sign in to comment.