crd

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 33 Imported by: 20

Documentation

Overview

Package crd handles the dynamic creation and modification of CustomResourceDefinitions.

Index

Constants

View Source
const CRDKind = "CustomResourceDefinition"

Variables

This section is empty.

Functions

func BatchCreateCRDs

func BatchCreateCRDs(ctx context.Context, crdClient clientv1.CustomResourceDefinitionInterface, labelSelector labels.Selector, waitDuration time.Duration, crds []*apiextv1.CustomResourceDefinition) error

BatchCreateCRDs will create or update the list of crds if they do not exist. It will wait for a specified amount of time for the CRD status to be established before returning an error. labelSelector can be used to scope the CRDs listed by this function.

func Create

func Create(ctx context.Context, cfg *rest.Config, crds []CRD) error

func Objects

func Objects(crds []CRD) (result []runtime.Object, err error)

func Print

func Print(out io.Writer, crds []CRD) error

func WriteFile

func WriteFile(filename string, crds []CRD) error

Types

type CRD

type CRD struct {
	GVK          schema.GroupVersionKind
	PluralName   string
	SingularName string
	NonNamespace bool
	Schema       *apiextv1.JSONSchemaProps
	SchemaObject interface{}
	Columns      []apiextv1.CustomResourceColumnDefinition
	Status       bool
	Scale        bool
	Categories   []string
	ShortNames   []string
	Labels       map[string]string
	Annotations  map[string]string

	Override runtime.Object
}

CRD defines information about a CRD that can be used to create a CustomResourceDefinition runtime.Object Deprecated: Rancher does not plan to continue support for dynamically defined CRDs

func FromGV

func FromGV(gv schema.GroupVersion, kind string) CRD

func NamespacedType

func NamespacedType(name string) CRD

func NamespacedTypes

func NamespacedTypes(names ...string) (ret []CRD)

func New

func New(group, version string) CRD

func NonNamespacedType

func NonNamespacedType(name string) CRD

func NonNamespacedTypes

func NonNamespacedTypes(names ...string) (ret []CRD)

func (*CRD) Name

func (c *CRD) Name() string

Name resolves the Name for the given CRD.

func (CRD) ToCustomResourceDefinition

func (c CRD) ToCustomResourceDefinition() (runtime.Object, error)

func (CRD) ToCustomResourceDefinitionV1Beta1

func (c CRD) ToCustomResourceDefinitionV1Beta1() (*apiextv1beta1.CustomResourceDefinition, error)

func (CRD) WithCategories

func (c CRD) WithCategories(categories ...string) CRD

func (CRD) WithColumn

func (c CRD) WithColumn(name, path string) CRD

func (CRD) WithColumnsFromStruct

func (c CRD) WithColumnsFromStruct(obj interface{}) CRD

func (CRD) WithCustomColumn

func (c CRD) WithCustomColumn(columns ...apiextv1.CustomResourceColumnDefinition) CRD

func (CRD) WithGroup

func (c CRD) WithGroup(group string) CRD

func (CRD) WithScale

func (c CRD) WithScale() CRD

func (CRD) WithSchema

func (c CRD) WithSchema(schema *apiextv1.JSONSchemaProps) CRD

func (CRD) WithSchemaFromStruct

func (c CRD) WithSchemaFromStruct(obj interface{}) CRD

func (CRD) WithShortNames

func (c CRD) WithShortNames(shortNames ...string) CRD

func (CRD) WithStatus

func (c CRD) WithStatus() CRD

type Factory

type Factory struct {
	CRDClient clientset.Interface
	// contains filtered or unexported fields
}

func NewFactoryFromClient

func NewFactoryFromClient(config *rest.Config) (*Factory, error)

func (*Factory) BatchCreateCRDs

func (f *Factory) BatchCreateCRDs(ctx context.Context, crds ...CRD) *Factory

func (*Factory) BatchWait

func (f *Factory) BatchWait() error

func (*Factory) CreateCRDs

Jump to

Keyboard shortcuts

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