crdpuller

package
v0.11.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 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

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)

Jump to

Keyboard shortcuts

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