Fix test cases that may potentially cause a panic.

Kubernetes-commit: 9e53371ddaaeab4083fde45e43c803071238e686
This commit is contained in:
novahe
2025-03-11 17:41:37 +08:00
committed by Kubernetes Publisher
parent 8ee5c997b3
commit 5c7f206b25
5 changed files with 21 additions and 0 deletions

View File

@@ -352,6 +352,7 @@ func TestCachedDiscoveryClientUnaggregatedServerGroups(t *testing.T) {
output, err := json.Marshal(body)
if err != nil {
t.Errorf("unexpected error %v", err)
return
}
// Content-type is "unaggregated" discovery format -- no resources returned.
w.Header().Set("Content-Type", discovery.AcceptV1)