client

package
v0.30.44 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 31 Imported by: 83

Documentation

Index

Constants

View Source
const (
	RetryTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

func BuildTypeMap added in v0.29.0

func CreateOrPatch

func CreateOrPatch(ctx context.Context, c client.Client, obj client.Object, transform TransformFunc, opts ...client.PatchOption) (kutil.VerbType, error)

func CreateOrPatchE added in v0.30.40

func CreateOrPatchE(ctx context.Context, c client.Client, obj client.Object, transform TransformFuncE, opts ...client.PatchOption) (kutil.VerbType, error)

func GetServiceAccountTokenSecret added in v0.25.36

func GetServiceAccountTokenSecret(kc client.Client, sa client.ObjectKey) (*core.Secret, error)

func NewAutoConvertClient added in v0.29.0

func NewAutoConvertClient(gvks ...schema.GroupVersionKind) client.NewClientFunc

func NewClient

func NewClient(config *restclient.Config, options client.Options) (client.Client, error)

func NewDelegatingClient

func NewDelegatingClient(in NewDelegatingClientInput) (client.Client, error)

NewDelegatingClient creates a new delegating client.

A delegating client forms a Client by composing separate reader, writer and statusclient interfaces. This way, you can have an Client that reads from a cache and writes to the API server.

func NewRetryClient added in v0.30.12

func NewRetryClient(d client.Client) client.Client

func NewRetryClientWithOptions added in v0.30.12

func NewRetryClientWithOptions(d client.Client, interval time.Duration, timeout time.Duration) client.Client

func NewUncachedClient

func NewUncachedClient(cfg *rest.Config, funcs ...func(*runtime.Scheme) error) (client.Client, error)

func Patch added in v0.30.41

func Patch(ctx context.Context, c client.Client, obj client.Object, transform PatchFunc, opts ...client.PatchOption) (kutil.VerbType, error)

func PatchE added in v0.30.41

func PatchE(ctx context.Context, c client.Client, obj client.Object, transform PatchFuncE, opts ...client.PatchOption) (kutil.VerbType, error)

func PatchStatus

func PatchStatus(ctx context.Context, c client.Client, obj client.Object, transform PatchFunc, opts ...client.SubResourcePatchOption) (kutil.VerbType, error)

func PatchStatusE added in v0.30.41

func PatchStatusE(ctx context.Context, c client.Client, obj client.Object, transform PatchFuncE, opts ...client.SubResourcePatchOption) (kutil.VerbType, error)

Types

type DelegatingClient added in v0.30.38

type DelegatingClient struct {
	client.Reader
	client.Writer
	client.StatusClient
	client.SubResourceClientConstructor
	// contains filtered or unexported fields
}

func (*DelegatingClient) GroupVersionKindFor added in v0.30.38

func (d *DelegatingClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)

GroupVersionKindFor returns the GroupVersionKind for the given object.

func (*DelegatingClient) Impersonate added in v0.30.38

func (d *DelegatingClient) Impersonate(u user.Info) (*restclient.Config, client.Client, error)

func (*DelegatingClient) IsObjectNamespaced added in v0.30.38

func (d *DelegatingClient) IsObjectNamespaced(obj runtime.Object) (bool, error)

IsObjectNamespaced returns true if the GroupVersionKind of the object is namespaced.

func (*DelegatingClient) RESTMapper added in v0.30.38

func (d *DelegatingClient) RESTMapper() meta.RESTMapper

RESTMapper returns the rest mapper this client is using.

func (*DelegatingClient) RestConfig added in v0.30.38

func (d *DelegatingClient) RestConfig() *restclient.Config

func (*DelegatingClient) Scheme added in v0.30.38

func (d *DelegatingClient) Scheme() *runtime.Scheme

Scheme returns the scheme this client is using.

func (*DelegatingClient) SubResource added in v0.30.38

func (d *DelegatingClient) SubResource(subResource string) client.SubResourceClient

type NewDelegatingClientInput

type NewDelegatingClientInput struct {
	CacheReader       client.Reader
	Client            client.Client
	UncachedObjects   []client.Object
	CacheUnstructured bool
	Cachable          apiutil2.Cachable
	// contains filtered or unexported fields
}

NewDelegatingClientInput encapsulates the input parameters to create a new delegating client.

type PatchFunc added in v0.30.41

type PatchFunc func(obj client.Object) client.Object

type PatchFuncE added in v0.30.41

type PatchFuncE func(obj client.Object) (client.Object, error)

type TransformFunc

type TransformFunc func(obj client.Object, createOp bool) client.Object

type TransformFuncE added in v0.30.40

type TransformFuncE func(obj client.Object, createOp bool) (client.Object, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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