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
- func NewSchemaPuller(discoveryClient discovery.DiscoveryInterface, ...) (*schemaPuller, 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)
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
func NewSchemaPuller ¶
func NewSchemaPuller( discoveryClient discovery.DiscoveryInterface, crdClient apiextensionsv1client.ApiextensionsV1Interface, ) (*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.
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)
Click to show internal directories.
Click to hide internal directories.