Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(ctx context.Context, baseSchema *types.APISchemas, client discovery.DiscoveryInterface, crd apiextcontrollerv1.CustomResourceDefinitionController, apiService v1.APIServiceController)
Register registers the schemaDefinition schema.
Types ¶
type SchemaDefinitionHandler ¶
type SchemaDefinitionHandler struct {
// contains filtered or unexported fields
}
SchemaDefinitionHandler provides a schema definition for the schema ID provided. The schema definition is built using the following information, in order:
- If the schema ID refers to a BaseSchema (a schema that doesn't exist in Kubernetes), then we use the schema to return the schema definition - we return early. Otherwise:
- We build a schema definition from the OpenAPI V2 info.
- If the schemaID refers to a CRD, then we also build a schema definition from the CRD.
- We merge both the OpenAPI V2 and the CRD schema definition. CRD will ALWAYS override whatever is in OpenAPI V2. This makes sense because CRD is defined by OpenAPI V3, so has more information. This merged schema definition is returned.
Note: SchemaDefinitionHandler only implements a ByID handler. It does not implement any method allowing a caller to list definitions for all schemas.
func NewSchemaDefinitionHandler ¶
func NewSchemaDefinitionHandler( baseSchema *types.APISchemas, crdCache wapiextv1.CustomResourceDefinitionCache, client discovery.DiscoveryInterface, ) *SchemaDefinitionHandler
func (*SchemaDefinitionHandler) Refresh ¶
func (s *SchemaDefinitionHandler) Refresh() error
Refresh writeLocks and updates the cache with new schemaDefinitions. Will result in a call to kubernetes to retrieve the openAPI schemas.
Click to show internal directories.
Click to hide internal directories.