Documentation ¶
Overview ¶
crdpuller package provides a library to pull API resource definitions from existing Kubernetes clusters as Custom Resource Definitions that can then be applied to a KCP instance.
- If a CRD already exists for a given resource in the targeted cluster, then it is reused. - If no CRD exist in the targeted cluster, then the CRD OpenAPI v3 schema is built from the openAPI v2 (Swagger) definitions published by the targeted cluster.
Index ¶
- func Convert(protoSchema proto.Schema, schemaProps *apiextensionsv1.JSONSchemaProps) []error
- type SchemaConverter
- func (sc *SchemaConverter) SubConverter(schemaProps *apiextensionsv1.JSONSchemaProps, description string) *SchemaConverter
- func (sc *SchemaConverter) VisitArbitrary(a *proto.Arbitrary)
- func (sc *SchemaConverter) VisitArray(a *proto.Array)
- func (sc *SchemaConverter) VisitKind(k *proto.Kind)
- func (sc *SchemaConverter) VisitMap(m *proto.Map)
- func (sc *SchemaConverter) VisitPrimitive(p *proto.Primitive)
- func (sc *SchemaConverter) VisitReference(r proto.Reference)
- type SchemaPuller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶ added in v0.6.0
func Convert(protoSchema proto.Schema, schemaProps *apiextensionsv1.JSONSchemaProps) []error
Types ¶
type SchemaConverter ¶
type SchemaConverter struct {
// contains filtered or unexported fields
}
func (*SchemaConverter) SubConverter ¶
func (sc *SchemaConverter) SubConverter(schemaProps *apiextensionsv1.JSONSchemaProps, description string) *SchemaConverter
func (*SchemaConverter) VisitArbitrary ¶
func (sc *SchemaConverter) VisitArbitrary(a *proto.Arbitrary)
func (*SchemaConverter) VisitArray ¶
func (sc *SchemaConverter) VisitArray(a *proto.Array)
func (*SchemaConverter) VisitKind ¶
func (sc *SchemaConverter) VisitKind(k *proto.Kind)
func (*SchemaConverter) VisitMap ¶
func (sc *SchemaConverter) VisitMap(m *proto.Map)
func (*SchemaConverter) VisitPrimitive ¶
func (sc *SchemaConverter) VisitPrimitive(p *proto.Primitive)
func (*SchemaConverter) VisitReference ¶
func (sc *SchemaConverter) VisitReference(r proto.Reference)
type SchemaPuller ¶
type SchemaPuller interface { // PullCRDs allows pulling the resources named by their plural names // and make them available as CRDs in the output map. PullCRDs(context context.Context, resourceNames ...string) (map[schema.GroupResource]*apiextensionsv1.CustomResourceDefinition, error) }
SchemaPuller allows pulling the API resources as CRDs from a kubernetes cluster.
func NewSchemaPuller ¶
func NewSchemaPuller(config *rest.Config) (SchemaPuller, error)
NewSchemaPuller allows creating a SchemaPuller from the `Config` of a given Kubernetes cluster, that will be able to pull API resources as CRDs from the given Kubernetes cluster.