kube

package
v1.125.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicWatch

type DynamicWatch interface {
	// Close stops the watch and frees resources.
	Close()
}

DynamicWatch is a handle to a watch; closing will free resources.

type KubeView

type KubeView[V any] struct {
	// contains filtered or unexported fields
}

KubeView listens to a watch, and stores the value of a function on each object.

func WatchKube

func WatchKube[V any](ctx context.Context, kube *Target, gvr schema.GroupVersionResource, fn func(*unstructured.Unstructured) V) *KubeView[V]

WatchKube constructs a KubeView.

func (*KubeView[V]) Close

func (m *KubeView[V]) Close()

func (*KubeView[V]) HasSyncedOnce

func (m *KubeView[V]) HasSyncedOnce() bool

HasSyncedOnce is true if we have seen all the objects at least once. This allows us to wait for the initial "list" to complete, though that list may be implemented via a watch.

func (*KubeView[V]) Snapshot

func (m *KubeView[V]) Snapshot() map[types.NamespacedName]V

Snapshot returns a deep-copy of the map

type Target

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

Target is a wrapper around a kubernetes client.

func NewTarget

func NewTarget(restConfig *rest.Config, httpClient *http.Client) (*Target, error)

NewTarget constructs a Target.

Jump to

Keyboard shortcuts

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