crd

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// ClusterScoped represents a type of a cluster scoped CRD.
	ClusterScoped = apiextensionsv1.ClusterScoped
	// NamespaceScoped represents a type of a namespaced scoped CRD.
	NamespaceScoped = apiextensionsv1.NamespaceScoped
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the CRD client implementation using API calls to kubernetes.

func NewClient

func NewClient(aeClient apiextensionscli.Interface, logger log.Logger) *Client

NewClient returns a new CRD client.

func NewCustomClient

func NewCustomClient(aeClient apiextensionscli.Interface, time wraptime.Time, logger log.Logger) *Client

NewCustomClient returns a new CRD client letting you set all the required parameters

func (*Client) Delete

func (c *Client) Delete(name string) error

Delete satisfies crd.Interface.

func (*Client) EnsurePresent

func (c *Client) EnsurePresent(conf Conf) error

EnsurePresent satisfies crd.Interface.

func (*Client) WaitToBePresent

func (c *Client) WaitToBePresent(name string, timeout time.Duration) error

WaitToBePresent satisfies crd.Interface.

type Conf

type Conf struct {
	// Kind is the kind of the CRD.
	Kind string
	// NamePlural is the plural name of the CRD (in most cases the plural of Kind).
	NamePlural string
	// ShortNames are short names of the CRD.  It must be all lowercase.
	ShortNames []string
	// Group is the group of the CRD.
	Group string
	// Version is the version of the CRD.
	Version string
	// Scope is the scode of the CRD (cluster scoped or namespace scoped).
	Scope Scope
	// Categories is a way of grouping multiple resources (example `kubectl get all`),
	// Kooper adds the CRD to `all` and `kooper` categories(apart from the described in Caregories).
	Categories []string
	// EnableStatus will enable the Status subresource on the CRD. This is feature
	// entered in v1.10 with the CRD subresources.
	// By default is disabled.
	EnableStatusSubresource bool
	// EnableScaleSubresource by default will be nil and means disabled, if
	// the object is present it will set this scale configuration to the subresource.
	EnableScaleSubresource *apiextensionsv1.CustomResourceSubresourceScale
}

Conf is the configuration required to create a CRD

type Interface

type Interface interface {
	// EnsureCreated will ensure the the CRD is present, this also means that
	// apart from creating the CRD if is not present it will wait until is
	// ready, this is a blocking operation and will return an error if timesout
	// waiting.
	EnsurePresent(conf Conf) error
	// WaitToBePresent will wait until the CRD is present, it will check if
	// is present at regular intervals until it timesout, in case of timeout
	// will return an error.
	WaitToBePresent(name string, timeout time.Duration) error
	// Delete will delete the CRD.
	Delete(name string) error
}

Interface is the CRD client that knows how to interact with k8s to manage them.

type Scope

Scope is the scope of a CRD.

Jump to

Keyboard shortcuts

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