kubeutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package kubeutil GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

View Source
var FieldOwner = client.FieldOwner("kubepkg")

Functions

func AllWatchableGroupVersionKinds added in v0.1.0

func AllWatchableGroupVersionKinds(ctx context.Context, conf *rest.Config) (gvks []schema.GroupVersionKind, err error)

func Annotate added in v0.1.0

func Annotate(o AnnotationsAccessor, key string, value string)

func AppendAnnotate added in v0.2.0

func AppendAnnotate(o AnnotationsAccessor, key string, value string)

func ApplyNamespace

func ApplyNamespace(ctx context.Context, c *rest.Config, namespace string) (*corev1.Namespace, error)

func ClientFromContext added in v0.2.0

func ClientFromContext(ctx context.Context) client.Client

func ContextWithClient added in v0.2.0

func ContextWithClient(ctx context.Context, c client.Client) context.Context

func GetAnnotate added in v0.1.0

func GetAnnotate(o AnnotationsAccessor, key string) string

func GetConfig

func GetConfig(kubeConfigPath string) (*rest.Config, error)

func GetLabel added in v0.1.0

func GetLabel(o LabelsAccessor, key string) string

func Intersection added in v0.2.0

func Intersection[E comparable](a []E, b []E) (c []E)

func KubeConfigFromClient

func KubeConfigFromClient(c client.Client) *rest.Config

func Label added in v0.1.0

func Label(o LabelsAccessor, key string, value string)

func NewClient

func NewClient(kubeConfigPath string) (client.Client, error)

func Union added in v0.2.0

func Union[E comparable](a []E, b []E) (c []E)

Types

type AnnotationsAccessor added in v0.1.0

type AnnotationsAccessor interface {
	GetAnnotations() map[string]string
	SetAnnotations(annotations map[string]string)
}

type CustomResourceDefinition

type CustomResourceDefinition struct {
	GroupVersion schema.GroupVersion
	KindType     runtime.Object
	ListKindType runtime.Object
	SpecType     any
	Plural       string
	ShortNames   []string
}

func (CustomResourceDefinition) RuntimeDoc added in v0.2.0

func (v CustomResourceDefinition) RuntimeDoc(names ...string) ([]string, bool)

type KubeClient added in v0.2.0

type KubeClient struct {
	// Paths to a kubeconfig. Only required if out-of-cluster.
	Kubeconfig string `flag:",omitempty"`
	// contains filtered or unexported fields
}

func (*KubeClient) Init added in v0.2.0

func (c *KubeClient) Init(ctx context.Context) error

func (*KubeClient) InjectContext added in v0.2.0

func (c *KubeClient) InjectContext(ctx context.Context) context.Context

func (KubeClient) RuntimeDoc added in v0.2.0

func (v KubeClient) RuntimeDoc(names ...string) ([]string, bool)

type LabelsAccessor added in v0.1.0

type LabelsAccessor interface {
	GetLabels() map[string]string
	SetLabels(labels map[string]string)
}

type Object

type Object = client.Object

func NewForGroupVersionKind

func NewForGroupVersionKind(gvk schema.GroupVersionKind) (Object, error)

func ObjectFromRuntimeObject

func ObjectFromRuntimeObject(ro runtime.Object) (Object, error)

type ObjectList

type ObjectList = client.ObjectList

func ObjectListFromRuntimeObject

func ObjectListFromRuntimeObject(ro runtime.Object) (ObjectList, error)

Jump to

Keyboard shortcuts

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