crdpuller

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 21 Imported by: 2

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL