controllerclient

package
v1.0.5-4 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 10 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 {
	Get(ctx context.Context, key k8sclient.ObjectKey, obj k8sclient.Object) error
	List(ctx context.Context, list k8sclient.ObjectList, opts ...k8sclient.ListOption) error
	Create(ctx context.Context, obj k8sclient.Object, opts ...CreateOption) error
	CreateOrUpdate(ctx context.Context, obj k8sclient.Object, opts ...CreateOrUpdateOption) error
	Delete(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.DeleteOption) error
	Patch(ctx context.Context, obj k8sclient.Object, patch k8sclient.Patch, opts ...PatchOption) error
	PatchStatus(ctx context.Context, obj k8sclient.Object, patch k8sclient.Patch, opts ...PatchOption) error
	Update(ctx context.Context, obj k8sclient.Object, opts ...UpdateOption) error
	UpdateStatus(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.UpdateOption) error
}

type ClientImpl

type ClientImpl struct {
	GlobalConfig GlobalConfig
	// contains filtered or unexported fields
}

func New

func (*ClientImpl) Create

func (c *ClientImpl) Create(ctx context.Context, obj k8sclient.Object, opts ...CreateOption) error

func (*ClientImpl) CreateOrUpdate

func (c *ClientImpl) CreateOrUpdate(ctx context.Context, obj k8sclient.Object, opts ...CreateOrUpdateOption) error

CreateOrUpdate does not support k8sclient.CreateOption or k8sclient.UpdateOption being passed as variadic parameters, if want to use opts use Create or Update methods

func (*ClientImpl) Delete

func (c *ClientImpl) Delete(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.DeleteOption) error

func (*ClientImpl) Get

func (*ClientImpl) List

func (*ClientImpl) Patch

func (c *ClientImpl) Patch(ctx context.Context, obj k8sclient.Object, patch k8sclient.Patch, opts ...PatchOption) error

func (*ClientImpl) PatchStatus

func (c *ClientImpl) PatchStatus(ctx context.Context, obj k8sclient.Object, patch k8sclient.Patch, opts ...PatchOption) error

If utilizing resilient option, nil can be passed for patch parameter

func (*ClientImpl) ResilientPatch

func (c *ClientImpl) ResilientPatch(ctx context.Context, obj k8sclient.Object, resilient *ResilientPatch, opts ...k8sclient.PatchOption) error

func (*ClientImpl) ResilientPatchStatus

func (c *ClientImpl) ResilientPatchStatus(ctx context.Context, obj k8sclient.Object, resilient *ResilientPatch, opts ...k8sclient.PatchOption) error

func (*ClientImpl) Update

func (c *ClientImpl) Update(ctx context.Context, obj k8sclient.Object, opts ...UpdateOption) error

NOTE: Currently, Resilient Update is not supported as it requires more specific implementation based on scenario. When possible, should utilize resilient Patch.

func (*ClientImpl) UpdateStatus

func (c *ClientImpl) UpdateStatus(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.UpdateOption) error

NOTE: Currently, Resilient UpdateStatus is not supported as it requires more specific implementation based on scenario. When possible, should utilize resilient PatchStatus.

type CreateOption

type CreateOption struct {
	Owner  v1.Object
	Scheme *runtime.Scheme
	Opts   []k8sclient.CreateOption
}

type CreateOrUpdateOption

type CreateOrUpdateOption struct {
	Owner  v1.Object
	Scheme *runtime.Scheme
}

type GlobalConfig

type GlobalConfig interface {
	Apply(runtime.Object)
}

GlobalConfig applies the global configuration defined in operator's config to appropriate kubernetes resources

type PatchOption

type PatchOption struct {
	Resilient *ResilientPatch
	Opts      []k8sclient.PatchOption
}

type ResilientPatch

type ResilientPatch struct {
	Retry    int
	Into     k8sclient.Object
	Strategy func(k8sclient.Object) k8sclient.Patch
}

type UpdateOption

type UpdateOption struct {
	Owner  v1.Object
	Scheme *runtime.Scheme
	Opts   []k8sclient.UpdateOption
}

Jump to

Keyboard shortcuts

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