Merge pull request #92537 from wojtek-t/fix_reflector_not_making_progress
Fix bug in reflector not recovering from "Too large resource version"… Kubernetes-commit: ed06981eab5e037b7d5b090b257054abb4d42ea0
This commit is contained in:
commit
62ce3afea6
|
|
@ -672,15 +672,15 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery",
|
"ImportPath": "k8s.io/apimachinery",
|
||||||
"Rev": "4149bbf8192b"
|
"Rev": "3c7bc0acc576"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/client-go",
|
"ImportPath": "k8s.io/client-go",
|
||||||
"Rev": "03667fd6b18f"
|
"Rev": "5f4e5d88ae20"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/component-base",
|
"ImportPath": "k8s.io/component-base",
|
||||||
"Rev": "f52a9b7250e8"
|
"Rev": "d18546f5347c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/gengo",
|
"ImportPath": "k8s.io/gengo",
|
||||||
|
|
|
||||||
12
go.mod
12
go.mod
|
|
@ -42,9 +42,9 @@ require (
|
||||||
gopkg.in/square/go-jose.v2 v2.2.2
|
gopkg.in/square/go-jose.v2 v2.2.2
|
||||||
gopkg.in/yaml.v2 v2.2.8
|
gopkg.in/yaml.v2 v2.2.8
|
||||||
k8s.io/api v0.0.0-20200630090439-aaebd44608df
|
k8s.io/api v0.0.0-20200630090439-aaebd44608df
|
||||||
k8s.io/apimachinery v0.0.0-20200630203207-4149bbf8192b
|
k8s.io/apimachinery v0.0.0-20200701090254-3c7bc0acc576
|
||||||
k8s.io/client-go v0.0.0-20200630090720-03667fd6b18f
|
k8s.io/client-go v0.0.0-20200701090722-5f4e5d88ae20
|
||||||
k8s.io/component-base v0.0.0-20200626131333-f52a9b7250e8
|
k8s.io/component-base v0.0.0-20200701091302-d18546f5347c
|
||||||
k8s.io/klog/v2 v2.1.0
|
k8s.io/klog/v2 v2.1.0
|
||||||
k8s.io/kube-openapi v0.0.0-20200427153329-656914f816f9
|
k8s.io/kube-openapi v0.0.0-20200427153329-656914f816f9
|
||||||
k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19
|
k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19
|
||||||
|
|
@ -55,7 +55,7 @@ require (
|
||||||
|
|
||||||
replace (
|
replace (
|
||||||
k8s.io/api => k8s.io/api v0.0.0-20200630090439-aaebd44608df
|
k8s.io/api => k8s.io/api v0.0.0-20200630090439-aaebd44608df
|
||||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20200630203207-4149bbf8192b
|
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20200701090254-3c7bc0acc576
|
||||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20200630090720-03667fd6b18f
|
k8s.io/client-go => k8s.io/client-go v0.0.0-20200701090722-5f4e5d88ae20
|
||||||
k8s.io/component-base => k8s.io/component-base v0.0.0-20200626131333-f52a9b7250e8
|
k8s.io/component-base => k8s.io/component-base v0.0.0-20200701091302-d18546f5347c
|
||||||
)
|
)
|
||||||
|
|
|
||||||
6
go.sum
6
go.sum
|
|
@ -507,9 +507,9 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
|
||||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||||
k8s.io/api v0.0.0-20200630090439-aaebd44608df/go.mod h1:cQk/DBCsCL81chJRAZjSBZ4suDeNugUZE3LqnYmbQ8Q=
|
k8s.io/api v0.0.0-20200630090439-aaebd44608df/go.mod h1:cQk/DBCsCL81chJRAZjSBZ4suDeNugUZE3LqnYmbQ8Q=
|
||||||
k8s.io/apimachinery v0.0.0-20200630203207-4149bbf8192b/go.mod h1:m5QoVMHU94aieNFPfLqf7WmU8HLVLm3JasG64COkSXQ=
|
k8s.io/apimachinery v0.0.0-20200701090254-3c7bc0acc576/go.mod h1:m5QoVMHU94aieNFPfLqf7WmU8HLVLm3JasG64COkSXQ=
|
||||||
k8s.io/client-go v0.0.0-20200630090720-03667fd6b18f/go.mod h1:emGJ1Ok1wvvwJsDNayMzuFecdtLv6Yr7HJnpojOq+AI=
|
k8s.io/client-go v0.0.0-20200701090722-5f4e5d88ae20/go.mod h1:Y5OYSw+CsoY5JMltVhj6q9JT4Z34smh50YxF7mGFK50=
|
||||||
k8s.io/component-base v0.0.0-20200626131333-f52a9b7250e8/go.mod h1:c8B2Gs7ipNKY0Hn4SBgCBsMo38vovG9B2E90kf+Fg1E=
|
k8s.io/component-base v0.0.0-20200701091302-d18546f5347c/go.mod h1:pGD8AyabkKuFECRDD6O/tqp75/EWa7AtVGYuU1zPLy8=
|
||||||
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||||
k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok=
|
k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok=
|
||||||
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
|
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,12 @@ var tooLargeResourceVersionCauseMsg = "Too large resource version"
|
||||||
// a minimum resource version that is larger than the largest currently available resource version for a requested resource.
|
// a minimum resource version that is larger than the largest currently available resource version for a requested resource.
|
||||||
func NewTooLargeResourceVersionError(minimumResourceVersion, currentRevision uint64, retrySeconds int) error {
|
func NewTooLargeResourceVersionError(minimumResourceVersion, currentRevision uint64, retrySeconds int) error {
|
||||||
err := errors.NewTimeoutError(fmt.Sprintf("Too large resource version: %d, current: %d", minimumResourceVersion, currentRevision), retrySeconds)
|
err := errors.NewTimeoutError(fmt.Sprintf("Too large resource version: %d, current: %d", minimumResourceVersion, currentRevision), retrySeconds)
|
||||||
err.ErrStatus.Details.Causes = []metav1.StatusCause{{Message: tooLargeResourceVersionCauseMsg}}
|
err.ErrStatus.Details.Causes = []metav1.StatusCause{
|
||||||
|
{
|
||||||
|
Type: metav1.CauseTypeResourceVersionTooLarge,
|
||||||
|
Message: tooLargeResourceVersionCauseMsg,
|
||||||
|
},
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -186,15 +191,5 @@ func IsTooLargeResourceVersion(err error) bool {
|
||||||
if !errors.IsTimeout(err) {
|
if !errors.IsTimeout(err) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
switch t := err.(type) {
|
return errors.HasStatusCause(err, metav1.CauseTypeResourceVersionTooLarge)
|
||||||
case errors.APIStatus:
|
|
||||||
if d := t.Status().Details; d != nil {
|
|
||||||
for _, cause := range d.Causes {
|
|
||||||
if cause.Message == tooLargeResourceVersionCauseMsg {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue