mirror of https://github.com/knative/caching.git
[master] Auto-update dependencies (#305)
Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign n3wscott vagababov /cc n3wscott vagababov
This commit is contained in:
parent
445f83d76e
commit
4976ef3755
2
go.mod
2
go.mod
|
@ -16,7 +16,7 @@ require (
|
|||
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
|
||||
k8s.io/code-generator v0.18.6
|
||||
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
|
||||
knative.dev/pkg v0.0.0-20200806230728-62f2560aa795
|
||||
knative.dev/pkg v0.0.0-20200810090030-095ff27da65c
|
||||
knative.dev/test-infra v0.0.0-20200806191129-68b7defbd189
|
||||
)
|
||||
|
||||
|
|
7
go.sum
7
go.sum
|
@ -1225,6 +1225,7 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
|||
go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
|
||||
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA=
|
||||
go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
|
||||
|
@ -1867,15 +1868,13 @@ knative.dev/pkg v0.0.0-20200505191044-3da93ebb24c2/go.mod h1:Q6sL35DdGs8hIQZKdaC
|
|||
knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY=
|
||||
knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA=
|
||||
knative.dev/pkg v0.0.0-20200711004937-22502028e31a/go.mod h1:AqAJV6rYi8IGikDjJ/9ZQd9qKdkXVlesVnVjwx62YB8=
|
||||
knative.dev/pkg v0.0.0-20200806230728-62f2560aa795 h1:7WSZvSc8SR2xLCjBUp5S0dg9e1AySM/xmOdpLGOMAtI=
|
||||
knative.dev/pkg v0.0.0-20200806230728-62f2560aa795/go.mod h1:0y8OGCR6F0bIaIT+pK8NXE/KtqfeXKAzDW56t7T0ENk=
|
||||
knative.dev/pkg v0.0.0-20200810090030-095ff27da65c h1:wumYkfbHgPQpwgidTSjIXv3lvr1SrJN+ztF3b4lD4bI=
|
||||
knative.dev/pkg v0.0.0-20200810090030-095ff27da65c/go.mod h1:BU3J2SM/hsc0DdfZJpDPJCP5dVQrPQl84U1x8PN8o9I=
|
||||
knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ=
|
||||
knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU=
|
||||
knative.dev/test-infra v0.0.0-20200513011557-d03429a76034/go.mod h1:aMif0KXL4g19YCYwsy4Ocjjz5xgPlseYV+B95Oo4JGE=
|
||||
knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9/go.mod h1:A5b2OAXTOeHT3hHhVQm3dmtbuWvIDP7qzgtqxA3/2pE=
|
||||
knative.dev/test-infra v0.0.0-20200707183444-aed09e56ddc7/go.mod h1:RjYAhXnZqeHw9+B0zsbqSPlae0lCvjekO/nw5ZMpLCs=
|
||||
knative.dev/test-infra v0.0.0-20200803175002-5efff0c4bd0a h1:0woae+DQoLaB8PBL1V2LKoPVOm3rldG4G1HYGROo1bo=
|
||||
knative.dev/test-infra v0.0.0-20200803175002-5efff0c4bd0a/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc=
|
||||
knative.dev/test-infra v0.0.0-20200806191129-68b7defbd189 h1:PkTuK9kgtsdwrIxUAmaCmDwfRKBoXujiqNRDWO1r8cc=
|
||||
knative.dev/test-infra v0.0.0-20200806191129-68b7defbd189/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc=
|
||||
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
|
||||
|
|
|
@ -147,6 +147,10 @@ func (g *reconcilerReconcilerGenerator) GenerateType(c *generator.Context, t *ty
|
|||
Package: "context",
|
||||
Name: "Context",
|
||||
}),
|
||||
"kmpSafeDiff": c.Universe.Function(types.Name{
|
||||
Package: "knative.dev/pkg/kmp",
|
||||
Name: "SafeDiff",
|
||||
}),
|
||||
"fmtErrorf": c.Universe.Package("fmt").Function("Errorf"),
|
||||
"reflectDeepEqual": c.Universe.Package("reflect").Function("DeepEqual"),
|
||||
"equalitySemantic": c.Universe.Package("k8s.io/apimachinery/pkg/api/equality").Variable("Semantic"),
|
||||
|
@ -350,7 +354,7 @@ var reconcilerImplFactory = `
|
|||
func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) error {
|
||||
logger := {{.loggingFromContext|raw}}(ctx)
|
||||
|
||||
// Initialize the reconciler state. This will convert the namespace/name
|
||||
// Initialize the reconciler state. This will convert the namespace/name
|
||||
// string into a distinct namespace and name, determin if this instance of
|
||||
// the reconciler is the leader, and any additional interfaces implemented
|
||||
// by the reconciler. Returns an error is the resource key is invalid.
|
||||
|
@ -359,7 +363,7 @@ func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) erro
|
|||
logger.Errorf("invalid resource key: %s", key)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
// If we are not the leader, and we don't implement either ReadOnly
|
||||
// observer interfaces, then take a fast-path out.
|
||||
if s.isNotLeaderNorObserver() {
|
||||
|
@ -458,7 +462,7 @@ func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) erro
|
|||
// the elected leader is expected to write modifications.
|
||||
logger.Warn("Saw status changes when we aren't the leader!")
|
||||
default:
|
||||
if err = r.updateStatus(original, resource); err != nil {
|
||||
if err = r.updateStatus(ctx, original, resource); err != nil {
|
||||
logger.Warnw("Failed to update resource status", zap.Error(err))
|
||||
r.Recorder.Eventf(resource, {{.corev1EventTypeWarning|raw}}, "UpdateFailed",
|
||||
"Failed to update status for %q: %v", resource.Name, err)
|
||||
|
@ -490,7 +494,7 @@ func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) erro
|
|||
`
|
||||
|
||||
var reconcilerStatusFactory = `
|
||||
func (r *reconcilerImpl) updateStatus(existing *{{.type|raw}}, desired *{{.type|raw}}) error {
|
||||
func (r *reconcilerImpl) updateStatus(ctx {{.contextContext|raw}}, existing *{{.type|raw}}, desired *{{.type|raw}}) error {
|
||||
existing = existing.DeepCopy()
|
||||
return {{.reconcilerRetryUpdateConflicts|raw}}(func(attempts int) (err error) {
|
||||
// The first iteration tries to use the injectionInformer's state, subsequent attempts fetch the latest state via API.
|
||||
|
@ -511,6 +515,10 @@ func (r *reconcilerImpl) updateStatus(existing *{{.type|raw}}, desired *{{.type|
|
|||
return nil
|
||||
}
|
||||
|
||||
if diff, err := {{.kmpSafeDiff|raw}}(existing.Status, desired.Status); err == nil && diff != "" {
|
||||
{{.loggingFromContext|raw}}(ctx).Debugf("Updating status with: %s", diff)
|
||||
}
|
||||
|
||||
existing.Status = desired.Status
|
||||
|
||||
{{if .nonNamespaced}}
|
||||
|
|
|
@ -33,13 +33,6 @@ import (
|
|||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// NewDefaultWatcher creates a new default configmap.Watcher instance.
|
||||
//
|
||||
// Deprecated: Use NewInformedWatcher
|
||||
func NewDefaultWatcher(kc kubernetes.Interface, namespace string) *InformedWatcher {
|
||||
return NewInformedWatcher(kc, namespace)
|
||||
}
|
||||
|
||||
// NewInformedWatcherFromFactory watches a Kubernetes namespace for ConfigMap changes.
|
||||
func NewInformedWatcherFromFactory(sif informers.SharedInformerFactory, namespace string) *InformedWatcher {
|
||||
return &InformedWatcher{
|
||||
|
|
|
@ -52,11 +52,15 @@ func newOpenCensusExporter(config *metricsConfig, logger *zap.SugaredLogger) (vi
|
|||
}
|
||||
logger.Infow("Created OpenCensus exporter with config:", zap.Any("config", *config))
|
||||
view.RegisterExporter(e)
|
||||
return e, getFactory(opts), nil
|
||||
return e, getFactory(e, opts), nil
|
||||
}
|
||||
|
||||
func getFactory(stored []ocagent.ExporterOption) ResourceExporterFactory {
|
||||
func getFactory(defaultExporter view.Exporter, stored []ocagent.ExporterOption) ResourceExporterFactory {
|
||||
return func(r *resource.Resource) (view.Exporter, error) {
|
||||
if r == nil || (r.Type == "" && len(r.Labels) == 0) {
|
||||
// Don't create duplicate exporters for the default exporter.
|
||||
return defaultExporter, nil
|
||||
}
|
||||
opts := append(stored, ocagent.WithResourceDetector(
|
||||
func(context.Context) (*resource.Resource, error) {
|
||||
return r, nil
|
||||
|
|
|
@ -177,6 +177,21 @@ func flushResourceExporters() {
|
|||
}
|
||||
}
|
||||
|
||||
// ClearMetersForTest clears the internal set of metrics being exported,
|
||||
// including cleaning up background threads.
|
||||
func ClearMetersForTest() {
|
||||
allMeters.lock.Lock()
|
||||
defer allMeters.lock.Unlock()
|
||||
|
||||
for k, meter := range allMeters.meters {
|
||||
if k == "" {
|
||||
continue
|
||||
}
|
||||
meter.m.Stop()
|
||||
delete(allMeters.meters, k)
|
||||
}
|
||||
}
|
||||
|
||||
func meterExporterForResource(r *resource.Resource) *meterExporter {
|
||||
key := resourceToKey(r)
|
||||
mE := allMeters.meters[key]
|
||||
|
|
|
@ -752,7 +752,7 @@ k8s.io/kube-openapi/pkg/util/sets
|
|||
k8s.io/utils/buffer
|
||||
k8s.io/utils/integer
|
||||
k8s.io/utils/trace
|
||||
# knative.dev/pkg v0.0.0-20200806230728-62f2560aa795
|
||||
# knative.dev/pkg v0.0.0-20200810090030-095ff27da65c
|
||||
## explicit
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck/ducktypes
|
||||
|
|
Loading…
Reference in New Issue