k8s

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MPL-2.0 Imports: 20 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 DeepEqual

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

func HasLabel

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

func IgnoreNotFound

func IgnoreNotFound(err error) error

func IsAlreadyExists

func IsAlreadyExists(err error) 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 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) GetVirtualEnvObj

func (r *Client) GetVirtualEnvObj(ctx context.Context, namespace, envId string, requireSnapshot bool) (v1alpha1.VirtualEnvObject, 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) SnapshotVirtualEnv

func (r *Client) SnapshotVirtualEnv(ctx context.Context, namespace, envName string) (*v1alpha1.VirtualEnvSnapshot, 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
JackTT - Gopher 🇻🇳