resource

package
v1.6.20 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Namespace returns the client namespace
	Namespace() string

	// Config returns the Kubernetes REST client configuration
	Config() *rest.Config

	// Clientset returns the client's Clientset
	Clientset() *kubernetes.Clientset
}

Client is a resource client

type Filter

type Filter func(kind metav1.GroupVersionKind, meta metav1.ObjectMeta) (bool, error)

Filter is a resource filter

var NoFilter Filter = func(kind metav1.GroupVersionKind, meta metav1.ObjectMeta) (bool, error) {
	return true, nil
}

NoFilter is a filter that accepts all resources

func NewUIDFilter

func NewUIDFilter(uids ...types.UID) Filter

NewUIDFilter returns a new filter for the given owner UIDs

type Kind

type Kind struct {
	Group   string
	Version string
	Kind    string
	Scoped  bool
}

Kind is a resource kind

type Resource

type Resource struct {
	Client
	Kind      Kind
	Namespace string
	Name      string
	UID       types.UID
}

Resource is a Kubernetes resource

func NewResource

func NewResource(meta metav1.ObjectMeta, kind Kind, client Client) *Resource

NewResource creates a new resource

type Type

type Type struct {
	Kind Kind
	Name string
}

Type is a resource type

type Waiter

type Waiter interface {
	Wait(time.Duration) error
}

Waiter is an interface for resources that support waiting for readiness

Jump to

Keyboard shortcuts

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