apiaggregation available controller should only hit required endpoint

This commit is contained in:
David Eads 2019-07-08 12:06:44 -04:00
parent 2c64ef5b71
commit a84db7e9de
2 changed files with 4 additions and 0 deletions

View File

@ -261,9 +261,11 @@ func (c *AvailableConditionController) sync(key string) error {
results <- err
return
}
discoveryURL.Path = "/apis/" + apiService.Spec.Group + "/" + apiService.Spec.Version
errCh := make(chan error)
go func() {
// be sure to check a URL that the aggregated API server is required to serve
newReq, err := http.NewRequest("GET", discoveryURL.String(), nil)
if err != nil {
errCh <- err

View File

@ -90,6 +90,8 @@ func newRemoteAPIService(name string) *apiregistration.APIService {
return &apiregistration.APIService{
ObjectMeta: metav1.ObjectMeta{Name: name},
Spec: apiregistration.APIServiceSpec{
Group: strings.SplitN(name, ".", 2)[0],
Version: strings.SplitN(name, ".", 2)[1],
Service: &apiregistration.ServiceReference{
Namespace: "foo",
Name: "bar",