Merge pull request #79895 from deads2k/aggregated-fix-endpont

apiaggregation available controller should only hit required endpoint
This commit is contained in:
Kubernetes Prow Robot 2019-07-08 20:30:52 -07:00 committed by GitHub
commit 262e59b2c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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",