diff --git a/test/e2e/apimachinery/protocol.go b/test/e2e/apimachinery/protocol.go index 9effdae5c1c..13ebccdf6f9 100644 --- a/test/e2e/apimachinery/protocol.go +++ b/test/e2e/apimachinery/protocol.go @@ -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 }