Handle missing OpenAPI specs on aggregated servers

Previously, the aggregator would fail to actually set up the aggregator
proxy for an API server that was missing an OpenAPI spec.  It would show
up in discovery, but the actual proxying would fail to occur.

Now, we simply log an error if we can't fetch an OpenAPI spec for a
particular aggregated server, and continue on.
This commit is contained in:
Solly Ross 2017-08-04 14:44:54 -04:00
parent 4a8d041c4c
commit 17eb58131a

View File

@ -17,6 +17,7 @@ limitations under the License.
package apiserver
import (
"fmt"
"net/http"
"time"
@ -26,6 +27,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/registry/rest"
@ -261,7 +263,7 @@ func (s *APIAggregator) AddAPIService(apiService *apiregistration.APIService) er
}
proxyHandler.updateAPIService(apiService)
if err := s.openAPIAggregator.loadApiServiceSpec(proxyHandler, apiService); err != nil {
return err
utilruntime.HandleError(fmt.Errorf("unable to load OpenAPI spec for API service %s: %v", apiService.Name, err))
}
s.proxyHandlers[apiService.Name] = proxyHandler
s.GenericAPIServer.Handler.NonGoRestfulMux.Handle(proxyPath, proxyHandler)