Skip to content

Commit

Permalink
[main] Upgrade to latest dependencies (#7429)
Browse files Browse the repository at this point in the history
upgrade to latest dependencies

bumping knative.dev/reconciler-test 212f3db...d2429fb:
  > d2429fb use context poll interval/timeout in DeleteResources (# 626)
  > 04b80d7 upgrade to latest dependencies (# 627)
bumping knative.dev/pkg acf0a2d...5c9b7a8:
  > 5c9b7a8 upgrade to latest dependencies (# 2887)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Nov 7, 2023
1 parent 62e797b commit cc3d30e
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 30 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ require (
k8s.io/utils v0.0.0-20230209194617-a36077c30491
knative.dev/hack v0.0.0-20231102183416-0d99b7ee9d63
knative.dev/hack/schema v0.0.0-20231102183416-0d99b7ee9d63
knative.dev/pkg v0.0.0-20231106073528-acf0a2d2dea9
knative.dev/reconciler-test v0.0.0-20231103063332-212f3db95925
knative.dev/pkg v0.0.0-20231107094615-5c9b7a8d8265
knative.dev/reconciler-test v0.0.0-20231107120858-d2429fb0b545
sigs.k8s.io/yaml v1.4.0
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -849,10 +849,10 @@ knative.dev/hack v0.0.0-20231102183416-0d99b7ee9d63 h1:QNbIbsep8jreNCXj3EFrsw0Rt
knative.dev/hack v0.0.0-20231102183416-0d99b7ee9d63/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/hack/schema v0.0.0-20231102183416-0d99b7ee9d63 h1:Kya5aD2/qIvQJBJv+ckrQfIBFLZ99gFr8ow+V6i4ZZY=
knative.dev/hack/schema v0.0.0-20231102183416-0d99b7ee9d63/go.mod h1:3pWwBLnTZSM9psSgCAvhKOHIPTzqfEMlWRpDu6IYhK0=
knative.dev/pkg v0.0.0-20231106073528-acf0a2d2dea9 h1:9JQb0ETlOXxtXb6zeJuvjcdsI5BQ83Rv1PEzIzC8B8U=
knative.dev/pkg v0.0.0-20231106073528-acf0a2d2dea9/go.mod h1:jCNm6Y66ArM8uDqpHwRwW7LuMFn79Q3KIn5L1R/WfI4=
knative.dev/reconciler-test v0.0.0-20231103063332-212f3db95925 h1:Iz7vRfFWMK2nu1znle0uXHg5bRPwCTAVFVwKir0tBl0=
knative.dev/reconciler-test v0.0.0-20231103063332-212f3db95925/go.mod h1:Ok0TfApVs8qkbytYq70Q7aetM21J3L41x9c3HKI/U1I=
knative.dev/pkg v0.0.0-20231107094615-5c9b7a8d8265 h1:wFDUSmvSQF48tUCIUIFKMOxq9jpV+vXf5l+RZYxYyt4=
knative.dev/pkg v0.0.0-20231107094615-5c9b7a8d8265/go.mod h1:P3m1Mg/FJjmr9oFHfWcoUbJLSlBi/hgwakobPxyqrZ4=
knative.dev/reconciler-test v0.0.0-20231107120858-d2429fb0b545 h1:0F0E77IbX5XxCxZ19Gopygwy+b6pVktrYAzMcFnVhK4=
knative.dev/reconciler-test v0.0.0-20231107120858-d2429fb0b545/go.mod h1:R7GebYEQbys4NXZJa0EzYx6+Hw3LZduuDkvp8FdBPU8=
pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
Expand Down
27 changes: 8 additions & 19 deletions vendor/knative.dev/reconciler-test/pkg/environment/timings.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,26 @@ package environment
import (
"context"
"time"

"knative.dev/reconciler-test/pkg/state"
)

// this has been moved to state pkg to break cycle between environment and feature package,
// keeping the consts here for backwards API compatibility
const (
DefaultPollInterval = 3 * time.Second
DefaultPollTimeout = 2 * time.Minute
)

type timingsKey struct{}
type timingsType struct {
interval time.Duration
timeout time.Duration
}

// PollTimingsFromContext will get the previously set poll timing from context,
// or return the defaults if not found.
// - values from from context.
// - defaults.
// ContextWithPollTimings returns a context with poll timings set
func ContextWithPollTimings(ctx context.Context, interval, timeout time.Duration) context.Context {
return context.WithValue(ctx, timingsKey{}, timingsType{
interval: interval,
timeout: timeout,
})
return state.ContextWithPollTimings(ctx, interval, timeout)
}

// PollTimingsFromContext will get the previously set poll timing from context,
// or return the defaults if not found.
// - values from from context.
// - values from context.
// - defaults.
func PollTimingsFromContext(ctx context.Context) (time.Duration, time.Duration) {
if t, ok := ctx.Value(timingsKey{}).(timingsType); ok {
return t.interval, t.timeout
}
return DefaultPollInterval, DefaultPollTimeout
return state.PollTimingsFromContext(ctx)
}
5 changes: 2 additions & 3 deletions vendor/knative.dev/reconciler-test/pkg/feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"runtime"
"strings"
"sync"
"time"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -32,7 +31,6 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"knative.dev/pkg/apis"
"knative.dev/pkg/injection/clients/dynamicclient"

"knative.dev/reconciler-test/pkg/state"
)

Expand Down Expand Up @@ -229,7 +227,8 @@ func DeleteResources(ctx context.Context, t T, refs []corev1.ObjectReference) er

var lastResource corev1.ObjectReference // One still present resource

err := wait.Poll(time.Second, 4*time.Minute, func() (bool, error) {
interval, timeout := state.PollTimingsFromContext(ctx)
err := wait.Poll(interval, timeout, func() (bool, error) {
for _, ref := range refs {
gv, err := schema.ParseGroupVersion(ref.APIVersion)
if err != nil {
Expand Down
52 changes: 52 additions & 0 deletions vendor/knative.dev/reconciler-test/pkg/state/timings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
Copyright 2021 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package state

import (
"context"
"time"
)

const (
DefaultPollInterval = 3 * time.Second
DefaultPollTimeout = 2 * time.Minute
)

type timingsKey struct{}
type timingsType struct {
interval time.Duration
timeout time.Duration
}

// ContextWithPollTimings returns a context with poll timings set
func ContextWithPollTimings(ctx context.Context, interval, timeout time.Duration) context.Context {
return context.WithValue(ctx, timingsKey{}, timingsType{
interval: interval,
timeout: timeout,
})
}

// PollTimingsFromContext will get the previously set poll timing from context,
// or return the defaults if not found.
// - values from context.
// - defaults.
func PollTimingsFromContext(ctx context.Context) (time.Duration, time.Duration) {
if t, ok := ctx.Value(timingsKey{}).(timingsType); ok {
return t.interval, t.timeout
}
return DefaultPollInterval, DefaultPollTimeout
}
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ knative.dev/hack/schema/commands
knative.dev/hack/schema/docs
knative.dev/hack/schema/registry
knative.dev/hack/schema/schema
# knative.dev/pkg v0.0.0-20231106073528-acf0a2d2dea9
# knative.dev/pkg v0.0.0-20231107094615-5c9b7a8d8265
## explicit; go 1.18
knative.dev/pkg/apiextensions/storageversion
knative.dev/pkg/apiextensions/storageversion/cmd/migrate
Expand Down Expand Up @@ -1350,7 +1350,7 @@ knative.dev/pkg/webhook/resourcesemantics
knative.dev/pkg/webhook/resourcesemantics/conversion
knative.dev/pkg/webhook/resourcesemantics/defaulting
knative.dev/pkg/webhook/resourcesemantics/validation
# knative.dev/reconciler-test v0.0.0-20231103063332-212f3db95925
# knative.dev/reconciler-test v0.0.0-20231107120858-d2429fb0b545
## explicit; go 1.20
knative.dev/reconciler-test/cmd/eventshub
knative.dev/reconciler-test/pkg/environment
Expand Down

0 comments on commit cc3d30e

Please sign in to comment.