1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-28 06:29:29 +01:00

Update Vendor Deps For k8s 1.19

This commit is contained in:
Sean Malloy
2020-08-27 23:49:48 -05:00
parent f4c3f9b18f
commit 674993d23a
30 changed files with 65 additions and 68 deletions

View File

@@ -1,8 +1,8 @@
language: go language: go
go: go:
- 1.8 - 1.14
- 1.7 - 1.13
install: install:
- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
@@ -11,6 +11,9 @@ install:
script: script:
- go get - go get
- go test -cover ./... - go test -cover ./...
- cd ./v5
- go get
- go test -cover ./...
notifications: notifications:
email: false email: false

View File

@@ -6,7 +6,7 @@ modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this * Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice * Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution. and/or other materials provided with the distribution.
* Neither the name of the Evan Phoenix nor the names of its contributors * Neither the name of the Evan Phoenix nor the names of its contributors

View File

@@ -1,5 +1,5 @@
# JSON-Patch # JSON-Patch
`jsonpatch` is a library which provides functionallity for both applying `jsonpatch` is a library which provides functionality for both applying
[RFC6902 JSON patches](http://tools.ietf.org/html/rfc6902) against documents, as [RFC6902 JSON patches](http://tools.ietf.org/html/rfc6902) against documents, as
well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ietf.org/html/rfc7396). well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ietf.org/html/rfc7396).
@@ -11,10 +11,11 @@ well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ie
**Latest and greatest**: **Latest and greatest**:
```bash ```bash
go get -u github.com/evanphx/json-patch go get -u github.com/evanphx/json-patch/v5
``` ```
**Stable Versions**: **Stable Versions**:
* Version 5: `go get -u gopkg.in/evanphx/json-patch.v5`
* Version 4: `go get -u gopkg.in/evanphx/json-patch.v4` * Version 4: `go get -u gopkg.in/evanphx/json-patch.v4`
(previous versions below `v3` are unavailable) (previous versions below `v3` are unavailable)
@@ -82,7 +83,7 @@ When ran, you get the following output:
```bash ```bash
$ go run main.go $ go run main.go
patch document: {"height":null,"name":"Jane"} patch document: {"height":null,"name":"Jane"}
updated tina doc: {"age":28,"name":"Jane"} updated alternative doc: {"age":28,"name":"Jane"}
``` ```
## Create and apply a JSON Patch ## Create and apply a JSON Patch
@@ -164,7 +165,7 @@ func main() {
} }
if !jsonpatch.Equal(original, different) { if !jsonpatch.Equal(original, different) {
fmt.Println(`"original" is _not_ structurally equal to "similar"`) fmt.Println(`"original" is _not_ structurally equal to "different"`)
} }
} }
``` ```
@@ -173,7 +174,7 @@ When ran, you get the following output:
```bash ```bash
$ go run main.go $ go run main.go
"original" is structurally equal to "similar" "original" is structurally equal to "similar"
"original" is _not_ structurally equal to "similar" "original" is _not_ structurally equal to "different"
``` ```
## Combine merge patches ## Combine merge patches

View File

@@ -1,5 +0,0 @@
module github.com/evanphx/json-patch
go 1.12
require github.com/pkg/errors v0.8.1

View File

@@ -1,2 +0,0 @@
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

View File

@@ -311,7 +311,12 @@ func matchesValue(av, bv interface{}) bool {
return false return false
} }
for key := range bt { for key := range bt {
if !matchesValue(at[key], bt[key]) { av, aOK := at[key]
bv, bOK := bt[key]
if aOK != bOK {
return false
}
if !matchesValue(av, bv) {
return false return false
} }
} }

View File

@@ -202,6 +202,10 @@ func (n *lazyNode) equal(o *lazyNode) bool {
return false return false
} }
if len(n.doc) != len(o.doc) {
return false
}
for k, v := range n.doc { for k, v := range n.doc {
ov, ok := o.doc[k] ov, ok := o.doc[k]
@@ -209,6 +213,10 @@ func (n *lazyNode) equal(o *lazyNode) bool {
return false return false
} }
if (v == nil) != (ov == nil) {
return false
}
if v == nil && ov == nil { if v == nil && ov == nil {
continue continue
} }
@@ -429,14 +437,14 @@ func (d *partialArray) add(key string, val *lazyNode) error {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
} }
if SupportNegativeIndices { if idx < 0 {
if !SupportNegativeIndices {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
}
if idx < -len(ary) { if idx < -len(ary) {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
} }
idx += len(ary)
if idx < 0 {
idx += len(ary)
}
} }
copy(ary[0:idx], cur[0:idx]) copy(ary[0:idx], cur[0:idx])
@@ -473,14 +481,14 @@ func (d *partialArray) remove(key string) error {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
} }
if SupportNegativeIndices { if idx < 0 {
if !SupportNegativeIndices {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
}
if idx < -len(cur) { if idx < -len(cur) {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
} }
idx += len(cur)
if idx < 0 {
idx += len(cur)
}
} }
ary := make([]*lazyNode, len(cur)-1) ary := make([]*lazyNode, len(cur)-1)

View File

@@ -31,7 +31,7 @@ import (
"k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/json"
utilruntime "k8s.io/apimachinery/pkg/util/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"sigs.k8s.io/structured-merge-diff/v3/value" "sigs.k8s.io/structured-merge-diff/v4/value"
"k8s.io/klog/v2" "k8s.io/klog/v2"
) )

View File

@@ -62,8 +62,11 @@ func JoinPreservingTrailingSlash(elem ...string) string {
// IsTimeout returns true if the given error is a network timeout error // IsTimeout returns true if the given error is a network timeout error
func IsTimeout(err error) bool { func IsTimeout(err error) bool {
neterr, ok := err.(net.Error) var neterr net.Error
return ok && neterr != nil && neterr.Timeout() if errors.As(err, &neterr) {
return neterr != nil && neterr.Timeout()
}
return false
} }
// IsProbableEOF returns true if the given error resembles a connection termination // IsProbableEOF returns true if the given error resembles a connection termination
@@ -76,7 +79,8 @@ func IsProbableEOF(err error) bool {
if err == nil { if err == nil {
return false return false
} }
if uerr, ok := err.(*url.Error); ok { var uerr *url.Error
if errors.As(err, &uerr) {
err = uerr.Err err = uerr.Err
} }
msg := err.Error() msg := err.Error()

View File

@@ -17,9 +17,8 @@ limitations under the License.
package net package net
import ( import (
"errors"
"net" "net"
"net/url"
"os"
"reflect" "reflect"
"syscall" "syscall"
) )
@@ -40,34 +39,18 @@ func IPNetEqual(ipnet1, ipnet2 *net.IPNet) bool {
// Returns if the given err is "connection reset by peer" error. // Returns if the given err is "connection reset by peer" error.
func IsConnectionReset(err error) bool { func IsConnectionReset(err error) bool {
if urlErr, ok := err.(*url.Error); ok { var errno syscall.Errno
err = urlErr.Err if errors.As(err, &errno) {
} return errno == syscall.ECONNRESET
if opErr, ok := err.(*net.OpError); ok {
err = opErr.Err
}
if osErr, ok := err.(*os.SyscallError); ok {
err = osErr.Err
}
if errno, ok := err.(syscall.Errno); ok && errno == syscall.ECONNRESET {
return true
} }
return false return false
} }
// Returns if the given err is "connection refused" error // Returns if the given err is "connection refused" error
func IsConnectionRefused(err error) bool { func IsConnectionRefused(err error) bool {
if urlErr, ok := err.(*url.Error); ok { var errno syscall.Errno
err = urlErr.Err if errors.As(err, &errno) {
} return errno == syscall.ECONNREFUSED
if opErr, ok := err.(*net.OpError); ok {
err = opErr.Err
}
if osErr, ok := err.(*os.SyscallError); ok {
err = osErr.Err
}
if errno, ok := err.(syscall.Errno); ok && errno == syscall.ECONNREFUSED {
return true
} }
return false return false
} }

View File

@@ -19,6 +19,6 @@ require (
golang.org/x/tools v0.0.0-20200616133436-c1934b75d054 // indirect golang.org/x/tools v0.0.0-20200616133436-c1934b75d054 // indirect
k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14
k8s.io/klog/v2 v2.2.0 k8s.io/klog/v2 v2.2.0
k8s.io/kube-openapi v0.0.0-20200427153329-656914f816f9 k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6
sigs.k8s.io/yaml v1.2.0 // indirect sigs.k8s.io/yaml v1.2.0 // indirect
) )

View File

@@ -132,9 +132,9 @@ k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-openapi v0.0.0-20200427153329-656914f816f9 h1:5NC2ITmvg8RoxoH0wgmL4zn4VZqXGsKbxrikjaQx6s4= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL1egv36TkkJm+bA8AxicmQ=
k8s.io/kube-openapi v0.0.0-20200427153329-656914f816f9/go.mod h1:bfCVj+qXcEaE5SCvzBaqpOySr6tuCcpPKqF6HD8nyCw= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=

20
vendor/modules.txt vendored
View File

@@ -22,7 +22,7 @@ github.com/dgrijalva/jwt-go
# github.com/emicklei/go-restful v2.9.5+incompatible # github.com/emicklei/go-restful v2.9.5+incompatible
github.com/emicklei/go-restful github.com/emicklei/go-restful
github.com/emicklei/go-restful/log github.com/emicklei/go-restful/log
# github.com/evanphx/json-patch v0.0.0-20190815234213-e83c0a1c26c8 # github.com/evanphx/json-patch v4.9.0+incompatible
github.com/evanphx/json-patch github.com/evanphx/json-patch
# github.com/go-logr/logr v0.2.0 # github.com/go-logr/logr v0.2.0
github.com/go-logr/logr github.com/go-logr/logr
@@ -183,7 +183,7 @@ google.golang.org/protobuf/types/known/timestamppb
gopkg.in/inf.v0 gopkg.in/inf.v0
# gopkg.in/yaml.v2 v2.2.8 # gopkg.in/yaml.v2 v2.2.8
gopkg.in/yaml.v2 gopkg.in/yaml.v2
# k8s.io/api v0.19.0-rc.4 # k8s.io/api v0.19.0
## explicit ## explicit
k8s.io/api/admissionregistration/v1 k8s.io/api/admissionregistration/v1
k8s.io/api/admissionregistration/v1beta1 k8s.io/api/admissionregistration/v1beta1
@@ -226,7 +226,7 @@ k8s.io/api/settings/v1alpha1
k8s.io/api/storage/v1 k8s.io/api/storage/v1
k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1alpha1
k8s.io/api/storage/v1beta1 k8s.io/api/storage/v1beta1
# k8s.io/apimachinery v0.19.0-rc.4 # k8s.io/apimachinery v0.19.0
## explicit ## explicit
k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/errors
k8s.io/apimachinery/pkg/api/meta k8s.io/apimachinery/pkg/api/meta
@@ -270,10 +270,10 @@ k8s.io/apimachinery/pkg/version
k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/pkg/watch
k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/json
k8s.io/apimachinery/third_party/forked/golang/reflect k8s.io/apimachinery/third_party/forked/golang/reflect
# k8s.io/apiserver v0.19.0-rc.4 # k8s.io/apiserver v0.19.0
## explicit ## explicit
k8s.io/apiserver/pkg/util/feature k8s.io/apiserver/pkg/util/feature
# k8s.io/client-go v0.19.0-rc.4 # k8s.io/client-go v0.19.0
## explicit ## explicit
k8s.io/client-go/discovery k8s.io/client-go/discovery
k8s.io/client-go/discovery/fake k8s.io/client-go/discovery/fake
@@ -490,7 +490,7 @@ k8s.io/client-go/util/homedir
k8s.io/client-go/util/jsonpath k8s.io/client-go/util/jsonpath
k8s.io/client-go/util/keyutil k8s.io/client-go/util/keyutil
k8s.io/client-go/util/workqueue k8s.io/client-go/util/workqueue
# k8s.io/code-generator v0.19.0-rc.4 # k8s.io/code-generator v0.19.0
## explicit ## explicit
k8s.io/code-generator k8s.io/code-generator
k8s.io/code-generator/cmd/client-gen k8s.io/code-generator/cmd/client-gen
@@ -525,7 +525,7 @@ k8s.io/code-generator/cmd/set-gen
k8s.io/code-generator/pkg/namer k8s.io/code-generator/pkg/namer
k8s.io/code-generator/pkg/util k8s.io/code-generator/pkg/util
k8s.io/code-generator/third_party/forked/golang/reflect k8s.io/code-generator/third_party/forked/golang/reflect
# k8s.io/component-base v0.19.0-rc.4 # k8s.io/component-base v0.19.0
## explicit ## explicit
k8s.io/component-base/cli/flag k8s.io/component-base/cli/flag
k8s.io/component-base/featuregate k8s.io/component-base/featuregate
@@ -545,7 +545,7 @@ k8s.io/gengo/types
# k8s.io/klog/v2 v2.2.0 # k8s.io/klog/v2 v2.2.0
## explicit ## explicit
k8s.io/klog/v2 k8s.io/klog/v2
# k8s.io/kube-openapi v0.0.0-20200427153329-656914f816f9 # k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6
k8s.io/kube-openapi/cmd/openapi-gen/args k8s.io/kube-openapi/cmd/openapi-gen/args
k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/common
k8s.io/kube-openapi/pkg/generators k8s.io/kube-openapi/pkg/generators
@@ -556,7 +556,7 @@ k8s.io/kube-openapi/pkg/util/sets
k8s.io/utils/buffer k8s.io/utils/buffer
k8s.io/utils/integer k8s.io/utils/integer
k8s.io/utils/trace k8s.io/utils/trace
# sigs.k8s.io/structured-merge-diff/v3 v3.0.1-0.20200706213357-43c19bbb7fba # sigs.k8s.io/structured-merge-diff/v4 v4.0.1
sigs.k8s.io/structured-merge-diff/v3/value sigs.k8s.io/structured-merge-diff/v4/value
# sigs.k8s.io/yaml v1.2.0 # sigs.k8s.io/yaml v1.2.0
sigs.k8s.io/yaml sigs.k8s.io/yaml