resources

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0 Imports: 10 Imported by: 44

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOption

type CreateOption func(*metav1.CreateOptions)

type DeleteOption

type DeleteOption func(*metav1.DeleteOptions)

func WithDeletePropagation added in v0.0.3

func WithDeletePropagation(prop string) DeleteOption

func WithGracePeriod added in v0.0.3

func WithGracePeriod(gpt time.Duration) DeleteOption

type ListOption

type ListOption func(*metav1.ListOptions)

func WithFieldSelector added in v0.0.3

func WithFieldSelector(sel string) ListOption

func WithLabelSelector added in v0.0.3

func WithLabelSelector(sel string) ListOption

func WithTimeout added in v0.0.3

func WithTimeout(to time.Duration) ListOption

type PatchOption added in v0.0.3

type PatchOption func(*metav1.PatchOptions)

PatchOption is used to provide additional arguments to the Patch call.

type Resources

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

func New

func New(cfg *rest.Config) (*Resources, error)

New instantiates the controller runtime client object. User can get panic for belopw scenarios. 1. if user does not provide k8s config 2. if controller runtime client instantiation fails.

func (*Resources) Annotate added in v0.0.3

func (r *Resources) Annotate(obj k8s.Object, annotation map[string]string)

Annotate attach annotations to an existing resource objec

func (*Resources) Create

func (r *Resources) Create(ctx context.Context, obj k8s.Object, opts ...CreateOption) error

func (*Resources) Delete

func (r *Resources) Delete(ctx context.Context, obj k8s.Object, opts ...DeleteOption) error

func (*Resources) Get

func (r *Resources) Get(ctx context.Context, name, namespace string, obj k8s.Object) error

func (*Resources) Label added in v0.0.3

func (r *Resources) Label(obj k8s.Object, label map[string]string)

Label apply labels to an existing resources.

func (*Resources) List

func (r *Resources) List(ctx context.Context, objs k8s.ObjectList, opts ...ListOption) error

func (*Resources) Patch added in v0.0.3

func (r *Resources) Patch(ctx context.Context, objs k8s.Object, patch k8s.Patch, opts ...PatchOption) error

Patch patches portion of object `orig` with data from object `patch`

func (*Resources) Update

func (r *Resources) Update(ctx context.Context, obj k8s.Object, opts ...UpdateOption) error

func (*Resources) WithNamespace

func (r *Resources) WithNamespace(ns string) *Resources

type UpdateOption

type UpdateOption func(*metav1.UpdateOptions)

Jump to

Keyboard shortcuts

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