resources

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 18 Imported by: 37

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) ExecInPod added in v0.1.0

func (r *Resources) ExecInPod(ctx context.Context, namespaceName, podName, containerName string, command []string, stdout, stderr *bytes.Buffer) error

func (*Resources) Get

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

func (*Resources) GetConfig added in v0.0.7

func (r *Resources) GetConfig() *rest.Config

GetConfig hepls to get config type *rest.Config

func (*Resources) GetControllerRuntimeClient added in v0.1.0

func (r *Resources) GetControllerRuntimeClient() cr.Client

GetClient return the controller-runtime client instance

func (*Resources) GetScheme added in v0.0.7

func (r *Resources) GetScheme() *runtime.Scheme

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, obj k8s.Object, patch k8s.Patch, opts ...PatchOption) error

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

func (*Resources) PatchStatus added in v0.3.0

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

PatchStatus patches portion of object `obj` with data from object `patch`

func (*Resources) PatchSubresource added in v0.3.0

func (r *Resources) PatchSubresource(ctx context.Context, obj k8s.Object, subresource string, patch k8s.Patch, opts ...PatchOption) error

PatchSubresource patches portion of object `obj` with data from object `patch`

func (*Resources) Update

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

func (*Resources) UpdateStatus added in v0.3.0

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

UpdateStatus updates the status of the object

func (*Resources) UpdateSubresource added in v0.3.0

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

UpdateSubresource updates the subresource of the object

func (*Resources) Watch added in v0.0.7

func (r *Resources) Watch(object k8s.ObjectList, opts ...ListOption) *watcher.EventHandlerFuncs

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