mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-08 14:29:45 +00:00
Fix third party APIResource reporting
This commit is contained in:
@@ -508,7 +508,7 @@ func TestDiscoveryAtAPIS(t *testing.T) {
|
||||
}
|
||||
|
||||
thirdPartyGV := unversioned.GroupVersionForDiscovery{GroupVersion: "company.com/v1", Version: "v1"}
|
||||
master.addThirdPartyResourceStorage("/apis/company.com/v1", nil,
|
||||
master.addThirdPartyResourceStorage("/apis/company.com/v1", "foos", nil,
|
||||
unversioned.APIGroup{
|
||||
Name: "company.com",
|
||||
Versions: []unversioned.GroupVersionForDiscovery{thirdPartyGV},
|
||||
@@ -575,10 +575,18 @@ func initThirdPartyMultiple(t *testing.T, versions, names []string) (*Master, *e
|
||||
},
|
||||
},
|
||||
}
|
||||
err := master.InstallThirdPartyResource(api)
|
||||
if !assert.NoError(err) {
|
||||
t.Logf("Failed to install API: %v", err)
|
||||
t.FailNow()
|
||||
hasRsrc, err := master.HasThirdPartyResource(api)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %v", err)
|
||||
}
|
||||
if !hasRsrc {
|
||||
err := master.InstallThirdPartyResource(api)
|
||||
if !assert.NoError(err) {
|
||||
t.Errorf("Failed to install API: %v", err)
|
||||
t.FailNow()
|
||||
}
|
||||
} else {
|
||||
t.Errorf("Expected %s: %v not to be present!", names[ix], api)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1078,7 +1086,7 @@ func testInstallThirdPartyResourceRemove(t *testing.T, version string) {
|
||||
}
|
||||
|
||||
path := makeThirdPartyPath("company.com")
|
||||
master.RemoveThirdPartyResource(path)
|
||||
master.RemoveThirdPartyResource(path + "/foos")
|
||||
|
||||
resp, err = http.Get(server.URL + "/apis/company.com/" + version + "/namespaces/default/foos/test")
|
||||
if !assert.NoError(err) {
|
||||
|
Reference in New Issue
Block a user