Documentation ¶
Overview ¶
Package apiserver provides an APIServer that can dynamically serve resources based on an API definition (CommonAPIResourceSpec) source and a Rest storage provider.
The main interface between this package and other components is the apidefs.APIDefinition:
- the configuration of the DynamicAPIServer contains an apidefs.APISetRetriever that allows retrieving an apidefs.APIDefinition based on an api domain key and a GVR
- the CreateServingInfoFor method can be used by external components at any time to create an apidefs.APIDefinition and add it to the apidefs.APISetRetriever that has been passed to the DynamicAPIServer
Parts of this package are highly inspired from k8s.io/apiextensions-apiserver/pkg/apiserver https://github.com/kcp-dev/kubernetes/tree/feature-logical-clusters-1.23/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateServingInfoFor ¶
func CreateServingInfoFor(genericConfig genericapiserver.CompletedConfig, apiResourceSchema *apisv1alpha1.APIResourceSchema, version string, restProvider RestProviderFunc) (apidefinition.APIDefinition, error)
CreateServingInfoFor builds an APIDefinition for a apiResourceSchema.
Types ¶
type CompletedConfig ¶
type CompletedConfig struct {
// contains filtered or unexported fields
}
func (CompletedConfig) New ¶
func (c CompletedConfig) New(virtualWorkspaceName string, delegationTarget genericapiserver.DelegationTarget) (*DynamicAPIServer, error)
New returns a new instance of DynamicAPIServer from the given config.
type DynamicAPIServer ¶
type DynamicAPIServer struct { GenericAPIServer *genericapiserver.GenericAPIServer APISetRetriever apidefinition.APIDefinitionSetGetter }
DynamicAPIServer contains state for a Kubernetes api server that can dynamically serve resources based on an API definitions (provided by the APISetRetriever).
type DynamicAPIServerConfig ¶
type DynamicAPIServerConfig struct { GenericConfig *genericapiserver.RecommendedConfig ExtraConfig DynamicAPIServerExtraConfig }
DynamicAPIServerConfig contains the configuration for the DynamicAPIServer
func (*DynamicAPIServerConfig) Complete ¶
func (c *DynamicAPIServerConfig) Complete() completedConfig
Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.
type DynamicAPIServerExtraConfig ¶
type DynamicAPIServerExtraConfig struct {
APISetRetriever apidefinition.APIDefinitionSetGetter
}
DynamicAPIServerExtraConfig contains additional configuration for the DynamicAPIServer
type RestProviderFunc ¶
type RestProviderFunc func(resource schema.GroupVersionResource, kind schema.GroupVersionKind, listKind schema.GroupVersionKind, typer runtime.ObjectTyper, tableConvertor rest.TableConvertor, namespaceScoped bool, schemaValidator *validate.SchemaValidator, subresourcesSchemaValidator map[string]*validate.SchemaValidator, structuralSchema *structuralschema.Structural) (mainStorage rest.Storage, subresourceStorages map[string]rest.Storage)
RestProviderFunc is the type of a function that builds REST storage implementations for the main resource and sub-resources, based on information passed by the resource handler about a given API.