upgrade to latest dependencies (#415)

bumping knative.dev/pkg f0ea5e6...5bb97df:
  > 5bb97df fix duration logging (# 1992)
  > a74906c Use structured logging to augment our logger vs. naming (# 1991)

Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
knative-automation 2021-01-18 06:41:21 -08:00 committed by GitHub
parent 3657044850
commit ba2835b006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 10 deletions

2
go.mod
View File

@ -18,5 +18,5 @@ require (
k8s.io/code-generator v0.18.12 k8s.io/code-generator v0.18.12
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
knative.dev/hack v0.0.0-20210114150620-4422dcadb3c8 knative.dev/hack v0.0.0-20210114150620-4422dcadb3c8
knative.dev/pkg v0.0.0-20210114223020-f0ea5e6b9c4e knative.dev/pkg v0.0.0-20210115202020-5bb97df49b44
) )

4
go.sum
View File

@ -1174,8 +1174,8 @@ knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24 h1:kIztWfvnIFV8Lhlea02K3YO2m
knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20210114150620-4422dcadb3c8 h1:N/Kt6C5zZzTtFcTntRThB+vEJ7WcLKaZ5Q2Jm7b23vw= knative.dev/hack v0.0.0-20210114150620-4422dcadb3c8 h1:N/Kt6C5zZzTtFcTntRThB+vEJ7WcLKaZ5Q2Jm7b23vw=
knative.dev/hack v0.0.0-20210114150620-4422dcadb3c8/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20210114150620-4422dcadb3c8/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/pkg v0.0.0-20210114223020-f0ea5e6b9c4e h1:3k5tzvlM9VGZFiXRj8UKc3CUpMGpqBlEbIY0Dp3F3NU= knative.dev/pkg v0.0.0-20210115202020-5bb97df49b44 h1:20uY2rKXoaAG7M86G7QPE7FhtOq1B0DeJ6Ron/AFPsQ=
knative.dev/pkg v0.0.0-20210114223020-f0ea5e6b9c4e/go.mod h1:hckgW978SdzPA2H5EDvRPY8xsnPuDZLJLbPf8Jte7Q0= knative.dev/pkg v0.0.0-20210115202020-5bb97df49b44/go.mod h1:hckgW978SdzPA2H5EDvRPY8xsnPuDZLJLbPf8Jte7Q0=
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 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= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=

View File

@ -170,6 +170,18 @@ func (g *reconcilerControllerGenerator) GenerateType(c *generator.Context, t *ty
Package: "fmt", Package: "fmt",
Name: "Sprintf", Name: "Sprintf",
}), }),
"logkeyControllerType": c.Universe.Constant(types.Name{
Package: "knative.dev/pkg/logging/logkey",
Name: "ControllerType",
}),
"logkeyControllerKind": c.Universe.Constant(types.Name{
Package: "knative.dev/pkg/logging/logkey",
Name: "Kind",
}),
"zapString": c.Universe.Function(types.Name{
Package: "go.uber.org/zap",
Name: "String",
}),
} }
sw.Do(reconcilerControllerNewImpl, m) sw.Do(reconcilerControllerNewImpl, m)
@ -227,10 +239,17 @@ func NewImpl(ctx {{.contextContext|raw}}, r Interface{{if .hasClass}}, classValu
{{if .hasClass}}classValue: classValue,{{end}} {{if .hasClass}}classValue: classValue,{{end}}
} }
t := {{.reflectTypeOf|raw}}(r).Elem() ctrType := {{.reflectTypeOf|raw}}(r).Elem()
queueName := {{.fmtSprintf|raw}}("%s.%s", {{.stringsReplaceAll|raw}}(t.PkgPath(), "/", "-"), t.Name()) ctrTypeName := {{.fmtSprintf|raw}}("%s.%s", ctrType.PkgPath(), ctrType.Name())
ctrTypeName = {{.stringsReplaceAll|raw}}(ctrTypeName, "/", ".")
impl := {{.controllerNewImpl|raw}}(rec, logger, queueName) logger = logger.With(
{{.zapString|raw}}({{.logkeyControllerType|raw}}, ctrTypeName),
{{.zapString|raw}}({{.logkeyControllerKind|raw}}, "{{ printf "%s.%s" .group .type.Name.Name }}"),
)
impl := {{.controllerNewImpl|raw}}(rec, logger, ctrTypeName)
agentName := defaultControllerAgentName agentName := defaultControllerAgentName
// Pass impl to the options. Save any optional results. // Pass impl to the options. Save any optional results.

View File

@ -230,7 +230,6 @@ func NewImplWithStats(r Reconciler, logger *zap.SugaredLogger, workQueueName str
// NewImplFull accepts the full set of options available to all controllers. // NewImplFull accepts the full set of options available to all controllers.
func NewImplFull(r Reconciler, options ControllerOptions) *Impl { func NewImplFull(r Reconciler, options ControllerOptions) *Impl {
logger := options.Logger.Named(options.WorkQueueName)
if options.RateLimiter == nil { if options.RateLimiter == nil {
options.RateLimiter = workqueue.DefaultControllerRateLimiter() options.RateLimiter = workqueue.DefaultControllerRateLimiter()
} }
@ -241,7 +240,7 @@ func NewImplFull(r Reconciler, options ControllerOptions) *Impl {
Name: options.WorkQueueName, Name: options.WorkQueueName,
Reconciler: r, Reconciler: r,
workQueue: newTwoLaneWorkQueue(options.WorkQueueName, options.RateLimiter), workQueue: newTwoLaneWorkQueue(options.WorkQueueName, options.RateLimiter),
logger: logger, logger: options.Logger,
statsReporter: options.Reporter, statsReporter: options.Reporter,
} }
} }
@ -528,7 +527,7 @@ func (c *Impl) processNextWorkItem() bool {
// Finally, if no error occurs we Forget this item so it does not // Finally, if no error occurs we Forget this item so it does not
// have any delay when another change happens. // have any delay when another change happens.
c.workQueue.Forget(key) c.workQueue.Forget(key)
logger.Info("Reconcile succeeded. Time taken: ", zap.Duration("duration", time.Since(startTime))) logger.Infow("Reconcile succeeded", zap.Duration("duration", time.Since(startTime)))
return true return true
} }

2
vendor/modules.txt vendored
View File

@ -655,7 +655,7 @@ k8s.io/utils/trace
# knative.dev/hack v0.0.0-20210114150620-4422dcadb3c8 # knative.dev/hack v0.0.0-20210114150620-4422dcadb3c8
## explicit ## explicit
knative.dev/hack knative.dev/hack
# knative.dev/pkg v0.0.0-20210114223020-f0ea5e6b9c4e # knative.dev/pkg v0.0.0-20210115202020-5bb97df49b44
## explicit ## explicit
knative.dev/pkg/apis knative.dev/pkg/apis
knative.dev/pkg/apis/duck knative.dev/pkg/apis/duck