Skip to content

Commit 869aef6

Browse files
committed
improves watch and report e2e test to also check IsResourceExpired since the API can return both errors (Gone, Expired)
1 parent ec4f3e3 commit 869aef6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/e2e/apimachinery/protocol.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ var _ = SIGDescribe("client-go should negotiate", func() {
6464
// this is allowed
6565
case watch.Error:
6666
err := errors.FromObject(evt.Object)
67-
if errors.IsGone(err) {
67+
// In Kubernetes 1.17 and earlier, the api server returns both apierrs.StatusReasonExpired and
68+
// apierrs.StatusReasonGone for HTTP 410 (Gone) status code responses. In 1.18 the kube server is more consistent
69+
// and always returns apierrs.StatusReasonExpired. For backward compatibility we can only remove the apierrs.IsGone
70+
// check when we fully drop support for Kubernetes 1.17 servers from reflectors.
71+
if errors.IsGone(err) || errors.IsResourceExpired(err) {
6872
// this is allowed, since the kubernetes object could be very old
6973
break
7074
}

0 commit comments

Comments
 (0)