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 results <- err
return return
} }
discoveryURL.Path = "/apis/" + apiService.Spec.Group + "/" + apiService.Spec.Version
errCh := make(chan error) errCh := make(chan error)
go func() { 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) newReq, err := http.NewRequest("GET", discoveryURL.String(), nil)
if err != nil { if err != nil {
errCh <- err errCh <- err

View File

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