mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-26 23:17:34 +00:00
Merge pull request #73243 from andrewsykim/update-utils-vendor
Update vendor k8s.io/utils and remove internal utils Kubernetes-commit: 2cbb16bc8dd456c5db72c1667926abdbc87c32c7
This commit is contained in:
commit
cce357d054
110
Godeps/Godeps.json
generated
110
Godeps/Godeps.json
generated
@ -404,207 +404,207 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
||||||
"Rev": "194b250ec96e370201081ab3110f2397477ba1c2"
|
"Rev": "0e6dcdd1b5ce54a78820c9bad24e2dd32b3b2e79"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/klog",
|
"ImportPath": "k8s.io/klog",
|
||||||
@ -614,6 +614,14 @@
|
|||||||
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
|
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
|
||||||
"Rev": "ced9eb3070a5f1c548ef46e8dfe2a97c208d9f03"
|
"Rev": "ced9eb3070a5f1c548ef46e8dfe2a97c208d9f03"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ImportPath": "k8s.io/utils/buffer",
|
||||||
|
"Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ImportPath": "k8s.io/utils/integer",
|
||||||
|
"Rev": "8a87304934321b4b0ad72a7cb3cbc715d67d38c7"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "sigs.k8s.io/yaml",
|
"ImportPath": "sigs.k8s.io/yaml",
|
||||||
"Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480"
|
"Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480"
|
||||||
|
2
tools/cache/shared_informer.go
vendored
2
tools/cache/shared_informer.go
vendored
@ -25,8 +25,8 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/clock"
|
"k8s.io/apimachinery/pkg/util/clock"
|
||||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/client-go/util/buffer"
|
|
||||||
"k8s.io/client-go/util/retry"
|
"k8s.io/client-go/util/retry"
|
||||||
|
"k8s.io/utils/buffer"
|
||||||
|
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
@ -1,72 +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 buffer
|
|
||||||
|
|
||||||
// RingGrowing is a growing ring buffer.
|
|
||||||
// Not thread safe.
|
|
||||||
type RingGrowing struct {
|
|
||||||
data []interface{}
|
|
||||||
n int // Size of Data
|
|
||||||
beg int // First available element
|
|
||||||
readable int // Number of data items available
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewRingGrowing constructs a new RingGrowing instance with provided parameters.
|
|
||||||
func NewRingGrowing(initialSize int) *RingGrowing {
|
|
||||||
return &RingGrowing{
|
|
||||||
data: make([]interface{}, initialSize),
|
|
||||||
n: initialSize,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadOne reads (consumes) first item from the buffer if it is available, otherwise returns false.
|
|
||||||
func (r *RingGrowing) ReadOne() (data interface{}, ok bool) {
|
|
||||||
if r.readable == 0 {
|
|
||||||
return nil, false
|
|
||||||
}
|
|
||||||
r.readable--
|
|
||||||
element := r.data[r.beg]
|
|
||||||
r.data[r.beg] = nil // Remove reference to the object to help GC
|
|
||||||
if r.beg == r.n-1 {
|
|
||||||
// Was the last element
|
|
||||||
r.beg = 0
|
|
||||||
} else {
|
|
||||||
r.beg++
|
|
||||||
}
|
|
||||||
return element, true
|
|
||||||
}
|
|
||||||
|
|
||||||
// WriteOne adds an item to the end of the buffer, growing it if it is full.
|
|
||||||
func (r *RingGrowing) WriteOne(data interface{}) {
|
|
||||||
if r.readable == r.n {
|
|
||||||
// Time to grow
|
|
||||||
newN := r.n * 2
|
|
||||||
newData := make([]interface{}, newN)
|
|
||||||
to := r.beg + r.readable
|
|
||||||
if to <= r.n {
|
|
||||||
copy(newData, r.data[r.beg:to])
|
|
||||||
} else {
|
|
||||||
copied := copy(newData, r.data[r.beg:])
|
|
||||||
copy(newData[copied:], r.data[:(to%r.n)])
|
|
||||||
}
|
|
||||||
r.beg = 0
|
|
||||||
r.data = newData
|
|
||||||
r.n = newN
|
|
||||||
}
|
|
||||||
r.data[(r.readable+r.beg)%r.n] = data
|
|
||||||
r.readable++
|
|
||||||
}
|
|
@ -1,50 +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 buffer
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGrowth(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
x := 10
|
|
||||||
g := NewRingGrowing(1)
|
|
||||||
for i := 0; i < x; i++ {
|
|
||||||
assert.Equal(t, i, g.readable)
|
|
||||||
g.WriteOne(i)
|
|
||||||
}
|
|
||||||
read := 0
|
|
||||||
for g.readable > 0 {
|
|
||||||
v, ok := g.ReadOne()
|
|
||||||
assert.True(t, ok)
|
|
||||||
assert.Equal(t, read, v)
|
|
||||||
read++
|
|
||||||
}
|
|
||||||
assert.Equalf(t, x, read, "expected to have read %d items: %d", x, read)
|
|
||||||
assert.Zerof(t, g.readable, "expected readable to be zero: %d", g.readable)
|
|
||||||
assert.Equalf(t, 16, g.n, "expected N to be 16: %d", g.n)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestEmpty(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
g := NewRingGrowing(1)
|
|
||||||
_, ok := g.ReadOne()
|
|
||||||
assert.False(t, ok)
|
|
||||||
}
|
|
@ -21,7 +21,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/clock"
|
"k8s.io/apimachinery/pkg/util/clock"
|
||||||
"k8s.io/client-go/util/integer"
|
"k8s.io/utils/integer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type backoffEntry struct {
|
type backoffEntry struct {
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2016 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 integer
|
|
||||||
|
|
||||||
func IntMax(a, b int) int {
|
|
||||||
if b > a {
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func IntMin(a, b int) int {
|
|
||||||
if b < a {
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func Int32Max(a, b int32) int32 {
|
|
||||||
if b > a {
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func Int32Min(a, b int32) int32 {
|
|
||||||
if b < a {
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func Int64Max(a, b int64) int64 {
|
|
||||||
if b > a {
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func Int64Min(a, b int64) int64 {
|
|
||||||
if b < a {
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
// RoundToInt32 rounds floats into integer numbers.
|
|
||||||
func RoundToInt32(a float64) int32 {
|
|
||||||
if a < 0 {
|
|
||||||
return int32(a - 0.5)
|
|
||||||
}
|
|
||||||
return int32(a + 0.5)
|
|
||||||
}
|
|
@ -1,244 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2016 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 integer
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestIntMax(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
nums []int
|
|
||||||
expectedMax int
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
nums: []int{-1, 0},
|
|
||||||
expectedMax: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int{-1, -2},
|
|
||||||
expectedMax: -1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int{0, 1},
|
|
||||||
expectedMax: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int{1, 2},
|
|
||||||
expectedMax: 2,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, test := range tests {
|
|
||||||
t.Logf("executing scenario %d", i)
|
|
||||||
if max := IntMax(test.nums[0], test.nums[1]); max != test.expectedMax {
|
|
||||||
t.Errorf("expected %v, got %v", test.expectedMax, max)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestIntMin(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
nums []int
|
|
||||||
expectedMin int
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
nums: []int{-1, 0},
|
|
||||||
expectedMin: -1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int{-1, -2},
|
|
||||||
expectedMin: -2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int{0, 1},
|
|
||||||
expectedMin: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int{1, 2},
|
|
||||||
expectedMin: 1,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, test := range tests {
|
|
||||||
t.Logf("executing scenario %d", i)
|
|
||||||
if min := IntMin(test.nums[0], test.nums[1]); min != test.expectedMin {
|
|
||||||
t.Errorf("expected %v, got %v", test.expectedMin, min)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestInt32Max(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
nums []int32
|
|
||||||
expectedMax int32
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
nums: []int32{-1, 0},
|
|
||||||
expectedMax: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int32{-1, -2},
|
|
||||||
expectedMax: -1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int32{0, 1},
|
|
||||||
expectedMax: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int32{1, 2},
|
|
||||||
expectedMax: 2,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, test := range tests {
|
|
||||||
t.Logf("executing scenario %d", i)
|
|
||||||
if max := Int32Max(test.nums[0], test.nums[1]); max != test.expectedMax {
|
|
||||||
t.Errorf("expected %v, got %v", test.expectedMax, max)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestInt32Min(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
nums []int32
|
|
||||||
expectedMin int32
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
nums: []int32{-1, 0},
|
|
||||||
expectedMin: -1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int32{-1, -2},
|
|
||||||
expectedMin: -2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int32{0, 1},
|
|
||||||
expectedMin: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int32{1, 2},
|
|
||||||
expectedMin: 1,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, test := range tests {
|
|
||||||
t.Logf("executing scenario %d", i)
|
|
||||||
if min := Int32Min(test.nums[0], test.nums[1]); min != test.expectedMin {
|
|
||||||
t.Errorf("expected %v, got %v", test.expectedMin, min)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestInt64Max(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
nums []int64
|
|
||||||
expectedMax int64
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
nums: []int64{-1, 0},
|
|
||||||
expectedMax: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int64{-1, -2},
|
|
||||||
expectedMax: -1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int64{0, 1},
|
|
||||||
expectedMax: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int64{1, 2},
|
|
||||||
expectedMax: 2,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, test := range tests {
|
|
||||||
t.Logf("executing scenario %d", i)
|
|
||||||
if max := Int64Max(test.nums[0], test.nums[1]); max != test.expectedMax {
|
|
||||||
t.Errorf("expected %v, got %v", test.expectedMax, max)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestInt64Min(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
nums []int64
|
|
||||||
expectedMin int64
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
nums: []int64{-1, 0},
|
|
||||||
expectedMin: -1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int64{-1, -2},
|
|
||||||
expectedMin: -2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int64{0, 1},
|
|
||||||
expectedMin: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
nums: []int64{1, 2},
|
|
||||||
expectedMin: 1,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, test := range tests {
|
|
||||||
t.Logf("executing scenario %d", i)
|
|
||||||
if min := Int64Min(test.nums[0], test.nums[1]); min != test.expectedMin {
|
|
||||||
t.Errorf("expected %v, got %v", test.expectedMin, min)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestRoundToInt32(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
num float64
|
|
||||||
exp int32
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
num: 5.5,
|
|
||||||
exp: 6,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
num: -3.7,
|
|
||||||
exp: -4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
num: 3.49,
|
|
||||||
exp: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
num: -7.9,
|
|
||||||
exp: -8,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
num: -4.499999,
|
|
||||||
exp: -4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
num: 0,
|
|
||||||
exp: 0,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, test := range tests {
|
|
||||||
t.Logf("executing scenario %d", i)
|
|
||||||
if got := RoundToInt32(test.num); got != test.exp {
|
|
||||||
t.Errorf("expected %d, got %d", test.exp, got)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user