kubernetes

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const DspKubernetesLabelDomain = "tiki-dsp.io"
View Source
const DspKubernetesLabelPrefix = DspKubernetesLabelDomain + "/"
View Source
const DspNamespaceEnv = "DSP_NAMESPACE"
View Source
const DspPodEnv = "DSP_POD"

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, obj Object, changedBy, changeReason string, forceOverwrite bool) (runtime.Object, error)

func Delete

func Delete(ctx context.Context, gvk schema.GroupVersionKind, namespace string, name string) error

func DeleteObject

func DeleteObject(ctx context.Context, obj Object) error

func DspLabel added in v2.7.0

func DspLabel(name string) string

func Get

func Get(ctx context.Context, gvk schema.GroupVersionKind, namespace string, name string) (runtime.Object, error)

func GetObject added in v2.0.10

func GetObject(ctx context.Context, obj Object) error

func GroupVersionKindForObject

func GroupVersionKindForObject(obj runtime.Object) (schema.GroupVersionKind, error)

func IsDspLabel added in v2.7.0

func IsDspLabel(label string) bool

func IsPvcResizingError added in v2.0.17

func IsPvcResizingError(err error) bool

func NewK8sObject added in v2.10.0

func NewK8sObject[TObj Object]() TObj

func NewSharedIndexInformer added in v2.10.0

func NewSharedIndexInformer[TObj Object](ctx context.Context, newLw NewListWatcherFunc, resyncPeriod time.Duration, indexers cache.Indexers) (cache.SharedIndexInformer, error)

NewSharedIndexInformer create a new SharedIndexInformer with given <resyncPeriod> and <indexers>. The NewListWatcherFunc will be called with a NamespaceableResourceInterface for the GroupVersionResource that was resolved for <TObj>.

If <newLw> is nil, a default list watcher for all namespaces with no list option modifications will be used.

If <indexers> is nil, a default indexer indexing by 'namespace': <namespace> will be used.

func StartAndSyncInformer added in v2.10.0

func StartAndSyncInformer(ctx context.Context, informer cache.SharedIndexInformer) bool

StartAndSyncInformer starts the informer in a goroutine and waits until the initial cache sync is done. it returns a boolean that signals if the cache sync was successful.

Both the informer and the cache sync can be stopped by cancelling the provided context.

func Watch added in v2.1.1

func Watch(ctx context.Context, gvk schema.GroupVersionKind, namespace string, options metaV1.ListOptions) (watch.Interface, error)

Types

type NewListWatcherFunc added in v2.10.0

type NewListWatcherFunc func(resourceInterface dynamic.NamespaceableResourceInterface) cache.ListerWatcher

func NewFilteredListWatcherFunc added in v2.10.0

func NewFilteredListWatcherFunc(ctx context.Context, namespace string, optionsModifier dynamicinformer.TweakListOptionsFunc) NewListWatcherFunc

NewFilteredListWatcherFunc creates a NewListWatcherFunc with the specified <ctx> and <namespace>.

If the optionsModifier is not nil, it will be applied to the ListOptions passed to the ListFunc and WatchFunc before calling List and Watch.

type Object added in v2.8.0

type Object interface {
	metaV1.Object
	runtime.Object
}

type PodReference

type PodReference struct {
	Namespace string `json:"namespace"`
	Pod       string `json:"pod"`
}

func GetCurrentPodReference

func GetCurrentPodReference() (*PodReference, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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