crd

package
v0.0.0-...-bb7034b Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteDefinition

func DeleteDefinition(clientset apiextensionsclient.Interface, h *Handle) error

DeleteDefinition removes the supplied CRD to the Kubernetes API server using the supplied client set.

func WriteDefinition

func WriteDefinition(clientset apiextensionsclient.Interface, h *Handle) error

WriteDefinition writes the supplied CRD to the Kubernetes API server using the supplied client set.

Types

type Client

type Client interface {
	Create(crd CustomResource) error
	Get(namespace string, name string) (runtime.Object, error)
	Update(crd CustomResource) (runtime.Object, error)
	Delete(namespace string, name string) error
	Validate(crd CustomResource) error
	RESTClient() rest.Interface
	List(namespace string, labels map[string]string) (runtime.Object, error)
}

Client is used to handle CRD operations.

func NewClient

func NewClient(config rest.Config, h *Handle) (Client, error)

NewClient returns a new REST client wrapper for the supplied CRD handle.

type CustomResource

type CustomResource interface {
	Name() string
	Namespace() string
	JSON() (string, error)
	GetSpecState() states.State
	GetStatusState() states.State
	SetStatusStateWithMessage(states.State, string)
	DeepCopyObject() runtime.Object
	GetObjectKind() schema.ObjectKind
}

CustomResource is the base type of custom resource objects. This allows them to be manipulated generically by the CRD client.

type CustomResourceList

type CustomResourceList interface {
	GetItems() []runtime.Object
	DeepCopyObject() runtime.Object
	GetObjectKind() schema.ObjectKind
}

type Handle

type Handle struct {
	SchemaGroupVersion schema.GroupVersion
	Definition         *extv1beta1.CustomResourceDefinition
	ResourceType       runtime.Object
	ResourceListType   runtime.Object
	Plural             string
	SchemaURL          string
}

Handle aggregates a CRD definition with additional data for client side (de)serialization.

func New

func New(
	resourceType runtime.Object,
	resourceListType runtime.Object,
	group string,
	version string,
	kind string,
	singular string,
	plural string,
	scope extv1beta1.ResourceScope,
	schemaURL string,
) *Handle

New returns a new CRD Handle.

Directories

Path Synopsis
+k8s:deepcopy-gen=package
+k8s:deepcopy-gen=package

Jump to

Keyboard shortcuts

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