client

package
v1.7.12 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package client is Kubernetes client for getting resource from Kubernetes cluster.

Package client is Kubernetes client for getting resource from Kubernetes cluster.

Index

Constants

View Source
const (
	DeletePropagationBackground = metav1.DeletePropagationBackground
	WatchDeletedEvent           = watch.Deleted
	SelectionOpEquals           = selection.Equals
	SelectionOpExists           = selection.Exists
)

Variables

View Source
var (
	ServerSideApply = cli.Apply
	MergePatch      = cli.Merge
	NewSelector     = labels.NewSelector
)

Functions

This section is empty.

Types

type Client

type Client interface {
	// Get retrieves an obj for the given object key from the Kubernetes Cluster.
	// obj must be a struct pointer so that obj can be updated with the response
	// returned by the Server.
	Get(ctx context.Context, name string, namespace string, obj Object, opts ...cli.GetOption) error
	// List retrieves list of objects for a given namespace and list options. On a
	// successful call, Items field in the list will be populated with the
	// result returned from the server.
	List(ctx context.Context, list cli.ObjectList, opts ...ListOption) error

	// Create saves the object obj in the Kubernetes cluster. obj must be a
	// struct pointer so that obj can be updated with the content returned by the Server.
	Create(ctx context.Context, obj Object, opts ...CreateOption) error

	// Delete deletes the given obj from Kubernetes cluster.
	Delete(ctx context.Context, obj Object, opts ...cli.DeleteOption) error

	// Update updates the given obj in the Kubernetes cluster. obj must be a
	// struct pointer so that obj can be updated with the content returned by the Server.
	Update(ctx context.Context, obj Object, opts ...cli.UpdateOption) error

	// Patch patches the given obj in the Kubernetes cluster. obj must be a
	// struct pointer so that obj can be updated with the content returned by the Server.
	Patch(ctx context.Context, obj Object, patch cli.Patch, opts ...cli.PatchOption) error

	// Watch watches the given obj for changes and takes the appropriate callbacks.
	Watch(ctx context.Context, obj cli.ObjectList, opts ...ListOption) (watch.Interface, error)

	// LabelSelector creates labels.Selector for Options like ListOptions.
	LabelSelector(key string, op selection.Operator, vals []string) (labels.Selector, error)
}

func New

func New(opts ...Option) (_ Client, err error)

type CreateOption

type CreateOption = cli.CreateOption

type CreateOptions

type CreateOptions = cli.CreateOptions

type DeleteAllOfOptions

type DeleteAllOfOptions = cli.DeleteAllOfOptions

type DeleteOptions

type DeleteOptions = cli.DeleteOptions

type Deployment added in v1.7.12

type Deployment = appsv1.Deployment

type DeploymentList added in v1.7.12

type DeploymentList = appsv1.DeploymentList

type InNamespace

type InNamespace = cli.InNamespace

type ListOption

type ListOption = cli.ListOption

type ListOptions

type ListOptions = cli.ListOptions

type MatchingLabels

type MatchingLabels = cli.MatchingLabels

type Object

type Object = cli.Object

type ObjectKey

type ObjectKey = cli.ObjectKey

type ObjectMeta added in v1.7.12

type ObjectMeta = metav1.ObjectMeta

type Option

type Option func(*client) error

func WithSchemeBuilder

func WithSchemeBuilder(sb scheme.Builder) Option

type Patcher added in v1.7.12

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

func NewPatcher added in v1.7.12

func NewPatcher(fieldManager string) (Patcher, error)

func (*Patcher) ApplyPodAnnotations added in v1.7.12

func (s *Patcher) ApplyPodAnnotations(ctx context.Context, name, namespace string, entries map[string]string) error

type UpdateOptions

type UpdateOptions = cli.UpdateOptions

type VolumeSnapshot

type VolumeSnapshot = snapshotv1.VolumeSnapshot

Jump to

Keyboard shortcuts

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