Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultServiceCacheSize is the default size of the OpenAPI service cache. // Equal API configurations in multiple workspaces are shared. DefaultServiceCacheSize = 100 // TODO(sttts): move to central place in kube. BoundAnnotationKey = "apis.kcp.io/bound-crd" )
View Source
const ControllerName = "kcp-openapiv3"
View Source
const CrdControllerName = "crd_openapi_v3_controller"
Variables ¶
This section is empty.
Functions ¶
func WithOpenAPIv3 ¶
func WithOpenAPIv3(handler http.Handler, c *ServiceCache) http.Handler
WithOpenAPIv3 returns a handler that serves OpenAPI v3 specs for CRDs, not forwarding /openapi/v3 requests to the delegate handler.
Types ¶
type CRDSpecGetter ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller watches CustomResourceDefinitions and publishes OpenAPI v3.
func NewController ¶
func NewController(crdInformer kcpapiextensionsv1informers.CustomResourceDefinitionClusterInformer) *Controller
NewController creates a new Controller with input CustomResourceDefinition informer.
func (*Controller) GetCRDSpecs ¶
func (*Controller) Run ¶
func (c *Controller) Run(ctx context.Context)
type ServiceCache ¶
type ServiceCache struct {
// contains filtered or unexported fields
}
ServiceCache implements a cluster-aware OpenAPI v3 handler, sharing the OpenAPI service for equal API surface configurations.
func NewServiceCache ¶
func NewServiceCache(config *common.OpenAPIV3Config, crdLister kcp.ClusterAwareCRDClusterLister, specGetter CRDSpecGetter, serviceCacheSize int) *ServiceCache
func (*ServiceCache) RegisterStaticAPIs ¶
func (c *ServiceCache) RegisterStaticAPIs(cont *restful.Container) error
func (*ServiceCache) ServeHTTP ¶
func (c *ServiceCache) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.