upgrade to latest dependencies (#405)

Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
knative-automation 2020-12-15 17:50:58 -08:00 committed by GitHub
parent 9bd909a648
commit a5041d5c0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 18 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-20201214230143-4ed1ecb8db24 knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24
knative.dev/pkg v0.0.0-20201214144644-909c15242675 knative.dev/pkg v0.0.0-20201215202458-ef8048c0ba77
) )

6
go.sum
View File

@ -1170,12 +1170,10 @@ k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE=
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/hack v0.0.0-20201201234937-fddbf732e450 h1:IyitWF7OzfunCgE4b9ZsJAeIRoQ6JOyqDrz/19X4iS4=
knative.dev/hack v0.0.0-20201201234937-fddbf732e450/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24 h1:kIztWfvnIFV8Lhlea02K3YO2mIzcDyQNzrBLn0Oq9sA= knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24 h1:kIztWfvnIFV8Lhlea02K3YO2mIzcDyQNzrBLn0Oq9sA=
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/pkg v0.0.0-20201214144644-909c15242675 h1:LoJ/axeH7J8ovl3+uELzmGUZ/hnjHeX7m6tZTrfk/P0= knative.dev/pkg v0.0.0-20201215202458-ef8048c0ba77 h1:N9DkFX8F4h86MGXgbvr5Sz9ojj6qMOm2IyIZRqXbC+g=
knative.dev/pkg v0.0.0-20201214144644-909c15242675/go.mod h1:9Z5HV80glvuMCv9oJqkWQcYoZrPAw8oA2C5JdFrNk0A= knative.dev/pkg v0.0.0-20201215202458-ef8048c0ba77/go.mod h1:VjrwVhfEZUnn6FruncHcBm854FldnRpekpyBbYtBvZM=
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

@ -420,9 +420,6 @@ func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) erro
logger = logger.With(zap.String("targetMethod", name)) logger = logger.With(zap.String("targetMethod", name))
switch name { switch name {
case {{.doReconcileKind|raw}}: case {{.doReconcileKind|raw}}:
// Append the target method to the logger.
logger = logger.With(zap.String("targetMethod", "ReconcileKind"))
// Set and update the finalizer on resource if r.reconciler // Set and update the finalizer on resource if r.reconciler
// implements Finalizer. // implements Finalizer.
if resource, err = r.setFinalizerIfFinalizer(ctx, resource); err != nil { if resource, err = r.setFinalizerIfFinalizer(ctx, resource); err != nil {

View File

@ -315,21 +315,45 @@ func resourceToKey(r *resource.Resource) string {
if r == nil { if r == nil {
return "" return ""
} }
// If there are no labels, we have just the Type.
if len(r.Labels) == 0 {
return r.Type
}
var s strings.Builder var s strings.Builder
l := len(r.Type) writeKV := func(key, value string) { // This lambda doesn't force an allocation.
kvs := make([]string, 0, len(r.Labels))
for k, v := range r.Labels {
l += len(k) + len(v) + 2
// We use byte values 1 and 2 to avoid colliding with valid resource labels // We use byte values 1 and 2 to avoid colliding with valid resource labels
// and to make unpacking easy // and to make unpacking easy
kvs = append(kvs, fmt.Sprintf("\x01%s\x02%s", k, v)) s.WriteByte('\x01')
s.WriteString(key)
s.WriteByte('\x02')
s.WriteString(value)
}
// If there's only one label, we can skip building and sorting a slice of keys.
if len(r.Labels) == 1 {
for k, v := range r.Labels {
// We know this only executes once.
s.Grow(len(r.Type) + len(k) + len(v) + 2)
s.WriteString(r.Type)
writeKV(k, v)
return s.String()
}
}
l := len(r.Type)
keys := make([]string, 0, len(r.Labels))
for k, v := range r.Labels {
l += len(k) + len(v) + 2
keys = append(keys, k)
} }
s.Grow(l) s.Grow(l)
s.WriteString(r.Type)
sort.Strings(kvs) // Go maps are unsorted, so sort by key to produce stable output. s.WriteString(r.Type)
for _, kv := range kvs { sort.Strings(keys) // Go maps are unsorted, so sort by key to produce stable output.
s.WriteString(kv) for _, key := range keys {
writeKV(key, r.Labels[key])
} }
return s.String() return s.String()

2
vendor/modules.txt vendored
View File

@ -748,7 +748,7 @@ k8s.io/utils/trace
# knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24 # knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24
## explicit ## explicit
knative.dev/hack knative.dev/hack
# knative.dev/pkg v0.0.0-20201214144644-909c15242675 # knative.dev/pkg v0.0.0-20201215202458-ef8048c0ba77
## explicit ## explicit
knative.dev/pkg/apis knative.dev/pkg/apis
knative.dev/pkg/apis/duck knative.dev/pkg/apis/duck