Skip to content

Commit

Permalink
upgrade to latest dependencies (#5556)
Browse files Browse the repository at this point in the history
bumping knative.dev/reconciler-test 88c8473...2a6d91d:
  > 2a6d91d upgrade to latest dependencies (# 222)
  > 9f3a27b Update community files (# 221)
  > 4d687fd Fix eventshub race (# 218)
bumping knative.dev/pkg dd0db4b...30f9568:
  > 30f9568 Update actions (# 2177)
  > 51cfaab Added inverse functions for the ptr package (# 2172)
  > cf1994e Update community files (# 2171)
  > 4cdacd0 add concurrency for each controller (# 2160)
  > e117baa Replace reference to obsolete xip.io service (# 2169)
  > a1bc850 Print proper warning logs from API warnings (# 2168)
  > a421cf1 upgrade to latest dependencies (# 2167)
  > 6b252df Update community files (# 2165)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation authored Jul 2, 2021
1 parent a574b7b commit 90932eb
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 9 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ require (
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
knative.dev/hack v0.0.0-20210622141627-e28525d8d260
knative.dev/hack/schema v0.0.0-20210622141627-e28525d8d260
knative.dev/pkg v0.0.0-20210622173328-dd0db4b05c80
knative.dev/reconciler-test v0.0.0-20210623134345-88c84739abd9
knative.dev/pkg v0.0.0-20210701025203-30f9568e894e
knative.dev/reconciler-test v0.0.0-20210630182710-2a6d91dfee1e
sigs.k8s.io/yaml v1.2.0
)

Expand Down
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1090,10 +1090,11 @@ knative.dev/hack v0.0.0-20210622141627-e28525d8d260 h1:f2eMtOubAOc/Q7JlvFPDKXiPl
knative.dev/hack v0.0.0-20210622141627-e28525d8d260/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack/schema v0.0.0-20210622141627-e28525d8d260 h1:YkMkZ7qdafyRHNIuKttYzEmM1ilKTGyEtPWeVLcLcDE=
knative.dev/hack/schema v0.0.0-20210622141627-e28525d8d260/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
knative.dev/pkg v0.0.0-20210622173328-dd0db4b05c80 h1:GHJ3lglE0/YHfBMMJqluqUNLOmsNXh7s7DBnfrkpRMM=
knative.dev/pkg v0.0.0-20210622173328-dd0db4b05c80/go.mod h1:kGegTnbZ+ljFjAE3E1+8wgaH2LMv8qYi+72o3F3cbdc=
knative.dev/reconciler-test v0.0.0-20210623134345-88c84739abd9 h1:j+ZLX0o1vBxEpTc7J6QT6sSBblQHpZhJP4vxbFe+C5Y=
knative.dev/reconciler-test v0.0.0-20210623134345-88c84739abd9/go.mod h1:4wqv2WyWUC5yhTesRUVwgjv/fHTHny1RYBfdB6tVDok=
knative.dev/pkg v0.0.0-20210701025203-30f9568e894e h1:2TofgD72tjBuWN3a4Rg3uzrMu1OWOlh2KY2m0fsjwqQ=
knative.dev/pkg v0.0.0-20210701025203-30f9568e894e/go.mod h1:kGegTnbZ+ljFjAE3E1+8wgaH2LMv8qYi+72o3F3cbdc=
knative.dev/reconciler-test v0.0.0-20210630182710-2a6d91dfee1e h1:OlvD5NiM8rl3j56NIQfmwSazBffwofQE+XDAt88+BV4=
knative.dev/reconciler-test v0.0.0-20210630182710-2a6d91dfee1e/go.mod h1:4wqv2WyWUC5yhTesRUVwgjv/fHTHny1RYBfdB6tVDok=
pgregory.net/rapid v0.3.3 h1:jCjBsY4ln4Atz78QoBWxUEvAHaFyNDQg9+WU62aCn1U=
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
12 changes: 11 additions & 1 deletion vendor/knative.dev/pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ var (
// when processing the controller's workqueue. Controller binaries
// may adjust this process-wide default. For finer control, invoke
// Run on the controller directly.
// TODO rename the const to Concurrency and deprecated this
DefaultThreadsPerController = 2
)

Expand Down Expand Up @@ -203,6 +204,9 @@ type Impl struct {
// which are not required to complete at the highest priority.
workQueue *twoLaneQueue

// Concurrency - The number of workers to use when processing the controller's workqueue.
Concurrency int

// Sugared logger is easier to use but is not as performant as the
// raw logger. In performance critical paths, call logger.Desugar()
// and use the returned raw logger instead. In addition to the
Expand All @@ -221,6 +225,7 @@ type ControllerOptions struct { //nolint // for backcompat.
Logger *zap.SugaredLogger
Reporter StatsReporter
RateLimiter workqueue.RateLimiter
Concurrency int
}

// NewImpl instantiates an instance of our controller that will feed work to the
Expand All @@ -244,12 +249,16 @@ func NewImplFull(r Reconciler, options ControllerOptions) *Impl {
if options.Reporter == nil {
options.Reporter = MustNewStatsReporter(options.WorkQueueName, options.Logger)
}
if options.Concurrency == 0 {
options.Concurrency = DefaultThreadsPerController
}
return &Impl{
Name: options.WorkQueueName,
Reconciler: r,
workQueue: newTwoLaneWorkQueue(options.WorkQueueName, options.RateLimiter),
logger: options.Logger,
statsReporter: options.Reporter,
Concurrency: options.Concurrency,
}
}

Expand Down Expand Up @@ -723,9 +732,10 @@ func StartAll(ctx context.Context, controllers ...*Impl) {
// Start all of the controllers.
for _, ctrlr := range controllers {
wg.Add(1)
concurrency := ctrlr.Concurrency
go func(c *Impl) {
defer wg.Done()
c.RunContext(ctx, DefaultThreadsPerController)
c.RunContext(ctx, concurrency)
}(ctrlr)
}
wg.Wait()
Expand Down
3 changes: 3 additions & 0 deletions vendor/knative.dev/pkg/controller/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ type Options struct {

// DemoteFunc configures the demote function this reconciler uses
DemoteFunc func(b reconciler.Bucket)

// Concurrency - The number of workers to use when processing the controller's workqueue.
Concurrency int
}

// OptionsFn is a callback method signature that accepts an Impl and returns
Expand Down
4 changes: 4 additions & 0 deletions vendor/knative.dev/pkg/injection/sharedmain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, cto
logger, atomicLevel := SetupLoggerOrDie(ctx, component)
defer flush(logger)
ctx = logging.WithLogger(ctx, logger)

// Override client-go's warning handler to give us nicely printed warnings.
rest.SetDefaultWarningHandler(&logging.WarningHandler{Logger: logger})

profilingHandler := profiling.NewHandler(logger, false)
profilingServer := profiling.NewServer(profilingHandler)

Expand Down
33 changes: 33 additions & 0 deletions vendor/knative.dev/pkg/logging/warning_handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
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 logging

import "go.uber.org/zap"

// WarningHandler is a warning handler to forward client-go's warning logs into a zap logger.
type WarningHandler struct {
Logger *zap.SugaredLogger
}

func (h *WarningHandler) HandleWarningHeader(code int, agent string, message string) {
// This condition is copied from K8s' default WarningLogger.
if code != 299 || len(message) == 0 {
return
}

h.Logger.Warn("API Warning: " + message)
}
91 changes: 91 additions & 0 deletions vendor/knative.dev/pkg/ptr/value.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
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 ptr

import "time"

// Int32Value is a helper for turning pointers to integers into values for use
// in API types that want int32.
func Int32Value(i *int32) int32 {
if i == nil {
return 0
}
return *i
}

// Int64Value is a helper for turning pointers to integers into values for use
// in API types that want int64.
func Int64Value(i *int64) int64 {
if i == nil {
return 0
}
return *i
}

// Float32Value is a helper for turning pointers to floats into values for use
// in API types that want float32.
func Float32Value(f *float32) float32 {
if f == nil {
return 0
}
return *f
}

// Float64Value is a helper for turning pointers to floats into values for use
// in API types that want float64.
func Float64Value(f *float64) float64 {
if f == nil {
return 0
}
return *f
}

// BoolValue is a helper for turning pointers to bools into values for use in
// API types that want bool.
func BoolValue(b *bool) bool {
if b == nil {
return false
}
return *b
}

// StringValue is a helper for turning pointers to strings into values for use
// in API types that want string.
func StringValue(s *string) string {
if s == nil {
return ""
}
return *s
}

// DurationValue is a helper for turning *time.Duration into values for use in
// API types that want time.Duration.
func DurationValue(t *time.Duration) time.Duration {
if t == nil {
return 0
}
return *t
}

// TimeValue is a helper for turning *time.Time into values for use in API
// types that want API types that want time.Time.
func TimeValue(t *time.Time) time.Time {
if t == nil {
return time.Time{}
}
return *t
}
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/test/spoof/spoof.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func DefaultErrorRetryChecker(err error) (bool, error) {
if isTCPTimeout(err) {
return true, fmt.Errorf("retrying for TCP timeout: %w", err)
}
// Retrying on DNS error, since we may be using xip.io or nip.io in tests.
// Retrying on DNS error, since we may be using sslip.io or nip.io in tests.
if isDNSError(err) {
return true, fmt.Errorf("retrying for DNS error: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,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-20210622173328-dd0db4b05c80
# knative.dev/pkg v0.0.0-20210701025203-30f9568e894e
## explicit
knative.dev/pkg/apiextensions/storageversion
knative.dev/pkg/apiextensions/storageversion/cmd/migrate
Expand Down Expand Up @@ -1139,7 +1139,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-20210623134345-88c84739abd9
# knative.dev/reconciler-test v0.0.0-20210630182710-2a6d91dfee1e
## explicit
knative.dev/reconciler-test/cmd/eventshub
knative.dev/reconciler-test/pkg/environment
Expand Down

0 comments on commit 90932eb

Please sign in to comment.