mirror of https://github.com/knative/caching.git
upgrade to latest dependencies (#372)
Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
11e52bba54
commit
20558e860c
2
go.mod
2
go.mod
|
@ -15,7 +15,7 @@ require (
|
|||
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
|
||||
k8s.io/code-generator v0.18.8
|
||||
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
|
||||
knative.dev/pkg v0.0.0-20201026232541-37583c54bfc3
|
||||
knative.dev/pkg v0.0.0-20201027121533-273ba59a1132
|
||||
knative.dev/test-infra v0.0.0-20201026182042-46291de4ab66
|
||||
)
|
||||
|
||||
|
|
9
go.sum
9
go.sum
|
@ -603,7 +603,6 @@ github.com/google/go-containerregistry v0.0.0-20200115214256-379933c9c22b/go.mod
|
|||
github.com/google/go-containerregistry v0.0.0-20200123184029-53ce695e4179/go.mod h1:Wtl/v6YdQxv397EREtzwgd9+Ud7Q5D8XMbi3Zazgkrs=
|
||||
github.com/google/go-containerregistry v0.0.0-20200331213917-3d03ed9b1ca2/go.mod h1:pD1UFYs7MCAx+ZLShBdttcaOSbyc8F9Na/9IZLNwJeA=
|
||||
github.com/google/go-containerregistry v0.1.1/go.mod h1:npTSyywOeILcgWqd+rvtzGWflIPPcBQhYoOONaY4ltM=
|
||||
github.com/google/go-containerregistry v0.1.3/go.mod h1:3Wg/Hjgn/ZDxrYYhtzZJWdThOd8zeI2zAmn4oVfm1Wg=
|
||||
github.com/google/go-containerregistry v0.1.4/go.mod h1:6EGiuQp36pL82lX6rFN0s9AJOVL0Mlgx/DAsYZW5X3s=
|
||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-github/v27 v27.0.6/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0=
|
||||
|
@ -1321,8 +1320,6 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh
|
|||
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE=
|
||||
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
|
@ -1935,15 +1932,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-20201026232541-37583c54bfc3 h1:YnoV/NKU0jt607ub1ra1RqCWMcoo9QLf8By9PAo8SSE=
|
||||
knative.dev/pkg v0.0.0-20201026232541-37583c54bfc3/go.mod h1:pc2VrtK69NrLtGMc6Gu0BL8IOfmph6KNvIDVrFqqW3Q=
|
||||
knative.dev/pkg v0.0.0-20201027121533-273ba59a1132 h1:P6/b3Bi+CcLQkjuDKNs2uE96MXa+uxJJ0PUGHe1Caoo=
|
||||
knative.dev/pkg v0.0.0-20201027121533-273ba59a1132/go.mod h1:vytY2kpkAbUm8yDIzJrLEgJ7FK/ieWuQDo4cNavAwuc=
|
||||
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-20201022003632-7d3ea6019158 h1:i6DIeWY1imJVNS6OH+VcBvYpVOkYWDe/AR2rUYTxcxE=
|
||||
knative.dev/test-infra v0.0.0-20201022003632-7d3ea6019158/go.mod h1:lm0U0k6ARXr8Po0LcSTCfETg63LOF3ajUxcoqy5JSH0=
|
||||
knative.dev/test-infra v0.0.0-20201026182042-46291de4ab66 h1:4GjjfWLzfsxN7xm+vkdC4AWqgTlw5mSQmTdSqPVfjlM=
|
||||
knative.dev/test-infra v0.0.0-20201026182042-46291de4ab66/go.mod h1:84HgSlMIp+oCx//g2Js61OxSVgdvrRYQMfMMr9kSSn4=
|
||||
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
Copyright 2017 The Kubernetes 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 fuzzer
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"github.com/google/gofuzz"
|
||||
|
||||
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
)
|
||||
|
||||
// FuzzerFuncs returns a list of func(*SomeType, c fuzz.Continue) functions.
|
||||
type FuzzerFuncs func(codecs runtimeserializer.CodecFactory) []interface{}
|
||||
|
||||
// FuzzerFor can randomly populate api objects that are destined for version.
|
||||
func FuzzerFor(funcs FuzzerFuncs, src rand.Source, codecs runtimeserializer.CodecFactory) *fuzz.Fuzzer {
|
||||
f := fuzz.New().NilChance(.5).NumElements(0, 1)
|
||||
if src != nil {
|
||||
f.RandSource(src)
|
||||
}
|
||||
f.Funcs(funcs(codecs)...)
|
||||
return f
|
||||
}
|
||||
|
||||
// MergeFuzzerFuncs will merge the given funcLists, overriding early funcs with later ones if there first
|
||||
// argument has the same type.
|
||||
func MergeFuzzerFuncs(funcs ...FuzzerFuncs) FuzzerFuncs {
|
||||
return FuzzerFuncs(func(codecs runtimeserializer.CodecFactory) []interface{} {
|
||||
result := []interface{}{}
|
||||
for _, f := range funcs {
|
||||
if f != nil {
|
||||
result = append(result, f(codecs)...)
|
||||
}
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
/*
|
||||
Copyright 2017 The Kubernetes 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 fuzzer
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// ValueFuzz recursively changes all basic type values in an object. Any kind of references will not
|
||||
// be touch, i.e. the addresses of slices, maps, pointers will stay unchanged.
|
||||
func ValueFuzz(obj interface{}) {
|
||||
valueFuzz(reflect.ValueOf(obj))
|
||||
}
|
||||
|
||||
func valueFuzz(obj reflect.Value) {
|
||||
switch obj.Kind() {
|
||||
case reflect.Array:
|
||||
for i := 0; i < obj.Len(); i++ {
|
||||
valueFuzz(obj.Index(i))
|
||||
}
|
||||
case reflect.Slice:
|
||||
if obj.IsNil() {
|
||||
// TODO: set non-nil value
|
||||
} else {
|
||||
for i := 0; i < obj.Len(); i++ {
|
||||
valueFuzz(obj.Index(i))
|
||||
}
|
||||
}
|
||||
case reflect.Interface, reflect.Ptr:
|
||||
if obj.IsNil() {
|
||||
// TODO: set non-nil value
|
||||
} else {
|
||||
valueFuzz(obj.Elem())
|
||||
}
|
||||
case reflect.Struct:
|
||||
for i, n := 0, obj.NumField(); i < n; i++ {
|
||||
valueFuzz(obj.Field(i))
|
||||
}
|
||||
case reflect.Map:
|
||||
if obj.IsNil() {
|
||||
// TODO: set non-nil value
|
||||
} else {
|
||||
for _, k := range obj.MapKeys() {
|
||||
// map values are not addressable. We need a copy.
|
||||
v := obj.MapIndex(k)
|
||||
copy := reflect.New(v.Type())
|
||||
copy.Elem().Set(v)
|
||||
valueFuzz(copy.Elem())
|
||||
obj.SetMapIndex(k, copy.Elem())
|
||||
}
|
||||
// TODO: set some new value
|
||||
}
|
||||
case reflect.Func: // ignore, we don't have function types in our API
|
||||
default:
|
||||
if !obj.CanSet() {
|
||||
return
|
||||
}
|
||||
switch obj.Kind() {
|
||||
case reflect.String:
|
||||
obj.SetString(obj.String() + "x")
|
||||
case reflect.Bool:
|
||||
obj.SetBool(!obj.Bool())
|
||||
case reflect.Float32, reflect.Float64:
|
||||
obj.SetFloat(obj.Float()*2.0 + 1.0)
|
||||
case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
|
||||
obj.SetInt(obj.Int() + 1)
|
||||
case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
|
||||
obj.SetUint(obj.Uint() + 1)
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
Copyright 2020 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 v1
|
||||
|
||||
import (
|
||||
fuzz "github.com/google/gofuzz"
|
||||
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
"knative.dev/pkg/apis"
|
||||
pkgfuzzer "knative.dev/pkg/apis/testing/fuzzer"
|
||||
)
|
||||
|
||||
var testConditions = apis.Conditions{{Type: apis.ConditionReady}, {Type: apis.ConditionSucceeded}}
|
||||
|
||||
// FuzzerFuncs includes fuzzing funcs for knative.dev/duck v1 types
|
||||
// In particular it makes sure that Delivery has only valid BackoffPolicyType in it.
|
||||
//
|
||||
// For other examples see
|
||||
// https://github.com/kubernetes/apimachinery/blob/master/pkg/apis/meta/fuzzer/fuzzer.go
|
||||
var FuzzerFuncs = fuzzer.MergeFuzzerFuncs(
|
||||
func(codecs serializer.CodecFactory) []interface{} {
|
||||
return []interface{}{
|
||||
func(status *Status, c fuzz.Continue) {
|
||||
c.FuzzNoCustom(status) // fuzz the Status
|
||||
status.SetConditions(testConditions)
|
||||
pkgfuzzer.FuzzConditions(status, c)
|
||||
},
|
||||
}
|
||||
},
|
||||
)
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
Copyright 2020 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 fuzzer
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"net/url"
|
||||
|
||||
fuzz "github.com/google/gofuzz"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
"knative.dev/pkg/apis"
|
||||
)
|
||||
|
||||
// Funcs includes fuzzing funcs for knative.dev/serving types
|
||||
//
|
||||
// For other examples see
|
||||
// https://github.com/kubernetes/apimachinery/blob/master/pkg/apis/meta/fuzzer/fuzzer.go
|
||||
var Funcs = fuzzer.MergeFuzzerFuncs(
|
||||
func(codecs serializer.CodecFactory) []interface{} {
|
||||
return []interface{}{
|
||||
func(u *apis.URL, c fuzz.Continue) {
|
||||
u.Scheme = randStringAtoZ(c.Rand)
|
||||
u.Host = randStringAtoZ(c.Rand)
|
||||
u.User = url.UserPassword(
|
||||
randStringAtoZ(c.Rand), // username
|
||||
randStringAtoZ(c.Rand), // password
|
||||
)
|
||||
u.RawPath = url.PathEscape(c.RandString())
|
||||
u.RawQuery = url.QueryEscape(c.RandString())
|
||||
},
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
// FuzzConditions fuzzes the values for the conditions. It doesn't add
|
||||
// any new condition types
|
||||
//
|
||||
// Consumers should initialize their conditions prior to fuzzing them.
|
||||
// For example:
|
||||
//
|
||||
// func(s *SomeStatus, c fuzz.Continue) {
|
||||
// c.FuzzNoCustom(s) // fuzz the status object
|
||||
//
|
||||
// // Clear the random fuzzed condition
|
||||
// s.Status.SetConditions(nil)
|
||||
//
|
||||
// // Fuzz the known conditions except their type value
|
||||
// s.InitializeConditions()
|
||||
// fuzz.Conditions(&s.Status, c)
|
||||
// }
|
||||
func FuzzConditions(accessor apis.ConditionsAccessor, c fuzz.Continue) {
|
||||
conds := accessor.GetConditions()
|
||||
for i, cond := range conds {
|
||||
// Leave condition.Type untouched
|
||||
cond.Status = corev1.ConditionStatus(c.RandString())
|
||||
cond.Severity = apis.ConditionSeverity(c.RandString())
|
||||
cond.Message = c.RandString()
|
||||
cond.Reason = c.RandString()
|
||||
c.FuzzNoCustom(&cond.LastTransitionTime)
|
||||
conds[i] = cond
|
||||
}
|
||||
accessor.SetConditions(conds)
|
||||
}
|
||||
|
||||
// taken from gofuzz internals for RandString
|
||||
type charRange struct {
|
||||
first, last rune
|
||||
}
|
||||
|
||||
func (c *charRange) choose(r *rand.Rand) rune {
|
||||
count := int64(c.last - c.first + 1)
|
||||
ch := c.first + rune(r.Int63n(count))
|
||||
|
||||
return ch
|
||||
}
|
||||
|
||||
// not fully exhaustive
|
||||
func randStringAtoZ(r *rand.Rand) string {
|
||||
hostCharRange := charRange{'a', 'z'}
|
||||
|
||||
n := r.Intn(20)
|
||||
runes := make([]rune, n)
|
||||
for i := range runes {
|
||||
runes[i] = hostCharRange.choose(r)
|
||||
}
|
||||
return string(runes)
|
||||
}
|
|
@ -455,7 +455,6 @@ k8s.io/api/storage/v1alpha1
|
|||
k8s.io/api/storage/v1beta1
|
||||
# k8s.io/apimachinery v0.18.8 => k8s.io/apimachinery v0.18.8
|
||||
## explicit
|
||||
k8s.io/apimachinery/pkg/api/apitesting/fuzzer
|
||||
k8s.io/apimachinery/pkg/api/equality
|
||||
k8s.io/apimachinery/pkg/api/errors
|
||||
k8s.io/apimachinery/pkg/api/meta
|
||||
|
@ -734,13 +733,12 @@ 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-20201026232541-37583c54bfc3
|
||||
# knative.dev/pkg v0.0.0-20201027121533-273ba59a1132
|
||||
## explicit
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck
|
||||
knative.dev/pkg/apis/duck/ducktypes
|
||||
knative.dev/pkg/apis/duck/v1
|
||||
knative.dev/pkg/apis/testing/fuzzer
|
||||
knative.dev/pkg/changeset
|
||||
knative.dev/pkg/codegen/cmd/injection-gen
|
||||
knative.dev/pkg/codegen/cmd/injection-gen/args
|
||||
|
|
Loading…
Reference in New Issue