k8s

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(o client.Object, finalizer string) bool

func Condition

func Condition(conds []metav1.Condition, typ string) *metav1.Condition

func ContainsFinalizer

func ContainsFinalizer(o client.Object, finalizer string) bool

func ContainsLabel

func ContainsLabel(obj client.Object, key, value string) bool

func DeepEqual

func DeepEqual(lhs interface{}, rhs interface{}) bool

func IgnoreNotFound

func IgnoreNotFound(err error) error

func IsAlreadyExists

func IsAlreadyExists(err error) bool

func IsAvailable

func IsAvailable(conds []metav1.Condition) bool

func IsConflict

func IsConflict(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func Key

func Key(namespace, name string) types.NamespacedName

func PodCondition

func PodCondition(pod *v1.Pod, typ v1.PodConditionType) v1.PodCondition

func RemoveFinalizer

func RemoveFinalizer(o client.Object, finalizer string) bool

func RemoveLabel

func RemoveLabel(obj client.Object, key string) bool

func ToString

func ToString(obj client.Object) string

func UpdateConditions

func UpdateConditions(now metav1.Time, current []metav1.Condition, toUpdate ...*metav1.Condition) []metav1.Condition

func UpdateLabel

func UpdateLabel(obj client.Object, key, value string) bool

Types

type Client

type Client struct {
	client.Client

	KubeConfig *cmdapi.Config
	RestConfig *rest.Config
	FieldOwner client.FieldOwner
}

func NewClient

func NewClient(fieldOwner client.FieldOwner) (*Client, error)

func (*Client) Apply

func (c *Client) Apply(ctx context.Context, obj client.Object, opts ...client.PatchOption) error

func (*Client) ApplyStatus

func (c *Client) ApplyStatus(ctx context.Context, obj client.Object, opts ...client.SubResourcePatchOption) error

func (*Client) Merge

func (c *Client) Merge(ctx context.Context, modified, original client.Object, opts ...client.PatchOption) error

func (*Client) MergeStatus

func (c *Client) MergeStatus(ctx context.Context, modified, original client.Object, opts ...client.SubResourcePatchOption) error

func (*Client) Upsert

func (c *Client) Upsert(ctx context.Context, obj client.Object, dryRun bool) error

Jump to

Keyboard shortcuts

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