From 7ceb279c871d214e4f5659db4faf9013ca519a49 Mon Sep 17 00:00:00 2001 From: Jacob See <5027680+jacobsee@users.noreply.github.com> Date: Mon, 23 Mar 2026 14:54:01 -0700 Subject: [PATCH] Treat groups as existent if they were found but discovery is stale The kube-apiserver still declares itself ready even with stale discovery entries. The stale entries would be refreshed by a background worker, but there's a race window where clients can hit a newly-ready kube-apiserver and get stale discovery data. For the purpose of answering whether they exist, return true as long as they do, even if the discovery data is currently stale. --- test/extended/util/framework.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/extended/util/framework.go b/test/extended/util/framework.go index 7a0681641256..7828562c2b2b 100644 --- a/test/extended/util/framework.go +++ b/test/extended/util/framework.go @@ -2233,6 +2233,12 @@ func DoesApiResourceExist(config *rest.Config, apiResourceName, group string) (b if errors.As(err, &groupFailed) { for gv, err := range groupFailed.Groups { if gv.Group == group { + if errors.As(err, &discovery.StaleGroupVersionError{}) { + // Group is registered but discovery is transiently stale. + // This can happen immediately after a restart and should resolve itself. + // For now, treat as "exists" since the APIService is known to the aggregator. + return true, nil + } return false, err } }