Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSchemaNotFound = fmt.Errorf("schema not found")
ErrSchemaNotFound is wrapped and returned if the schema cannot be located by the resolver.
Functions ¶
This section is empty.
Types ¶
type ClientDiscoveryResolver ¶
type ClientDiscoveryResolver struct {
Discovery discovery.DiscoveryInterface
}
ClientDiscoveryResolver uses client-go discovery to resolve schemas at run time.
func (*ClientDiscoveryResolver) ResolveSchema ¶
func (r *ClientDiscoveryResolver) ResolveSchema(gvk schema.GroupVersionKind) (*spec.Schema, error)
type DefinitionsSchemaResolver ¶
type DefinitionsSchemaResolver struct {
// contains filtered or unexported fields
}
DefinitionsSchemaResolver resolves the schema of a built-in type by looking up the OpenAPI definitions.
func NewDefinitionsSchemaResolver ¶
func NewDefinitionsSchemaResolver(scheme *runtime.Scheme, getDefinitions common.GetOpenAPIDefinitions) *DefinitionsSchemaResolver
NewDefinitionsSchemaResolver creates a new DefinitionsSchemaResolver. An example working setup: scheme = "k8s.io/client-go/kubernetes/scheme".Scheme getDefinitions = "k8s.io/kubernetes/pkg/generated/openapi".GetOpenAPIDefinitions
func (*DefinitionsSchemaResolver) ResolveSchema ¶
func (d *DefinitionsSchemaResolver) ResolveSchema(gvk schema.GroupVersionKind) (*spec.Schema, error)
type SchemaResolver ¶
type SchemaResolver interface { // ResolveSchema takes a GroupVersionKind (GVK) and returns the OpenAPI schema // identified by the GVK. // The function returns a non-nil error if the schema cannot be found or fail // to resolve. The returned error wraps ErrSchemaNotFound if the resolution is // attempted but the corresponding schema cannot be found. ResolveSchema(gvk schema.GroupVersionKind) (*spec.Schema, error) }
SchemaResolver finds the OpenAPI schema for the given GroupVersionKind. This interface uses the type defined by k8s.io/kube-openapi
Click to show internal directories.
Click to hide internal directories.