Merge pull request #86354 from p0lyn0mial/improve-watch-and-report-e2e

improves watch and report e2e
This commit is contained in:
Kubernetes Prow Robot 2019-12-19 10:11:57 -08:00 committed by GitHub
commit 810f0c2ae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,11 @@ var _ = SIGDescribe("client-go should negotiate", func() {
// this is allowed
case watch.Error:
err := errors.FromObject(evt.Object)
if errors.IsGone(err) {
// In Kubernetes 1.17 and earlier, the api server returns both apierrs.StatusReasonExpired and
// apierrs.StatusReasonGone for HTTP 410 (Gone) status code responses. In 1.18 the kube server is more consistent
// and always returns apierrs.StatusReasonExpired. For backward compatibility we can only remove the apierrs.IsGone
// check when we fully drop support for Kubernetes 1.17 servers from reflectors.
if errors.IsGone(err) || errors.IsResourceExpired(err) {
// this is allowed, since the kubernetes object could be very old
break
}