improves watch and report e2e test to also check IsResourceExpired since the API can return both errors (Gone, Expired)

This commit is contained in:
Lukasz Szaszkiewicz 2019-12-17 14:29:08 +01:00
parent ec4f3e3064
commit 869aef61af

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
}