k8s

package
v2.5.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	*Config
	// contains filtered or unexported fields
}

Cluster is a Kubernetes cluster reference

func NewCluster

func NewCluster(c context.Context, kubeFlags *Config, namespaces []string) (*Cluster, error)

func (*Cluster) ActualNamespace

func (kc *Cluster) ActualNamespace(namespace string) string

func (*Cluster) AddNamespaceListener

func (kc *Cluster) AddNamespaceListener(nsListener NamespaceListener)

func (*Cluster) FindPodFromSelector

func (kc *Cluster) FindPodFromSelector(c context.Context, namespace string, selector map[string]string) (k8sapi.Object, error)

FindPodFromSelector returns a pod with the given name-hex-hex

func (*Cluster) GetClusterId

func (kc *Cluster) GetClusterId(ctx context.Context) string

func (*Cluster) GetCurrentNamespaces

func (kc *Cluster) GetCurrentNamespaces(forClientAccess bool) []string

GetCurrentNamespaces returns the names of the namespaces that this client is mapping. If the forClientAccess is true, then the namespaces are restricted to those where an intercept can take place, i.e. the namespaces where this client can Watch and get services and deployments.

func (*Cluster) SetMappedNamespaces

func (kc *Cluster) SetMappedNamespaces(c context.Context, namespaces []string) bool

func (*Cluster) WaitForNSSync

func (kc *Cluster) WaitForNSSync(c context.Context)

func (*Cluster) WithK8sInterface

func (kc *Cluster) WithK8sInterface(c context.Context) context.Context

type Config

type Config struct {
	Namespace string // default cluster namespace.
	Context   string
	Server    string

	ConfigFlags *genericclioptions.ConfigFlags
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(c context.Context, flagMap map[string]string) (*Config, error)

func (*Config) ContextServiceAndFlagsEqual

func (kf *Config) ContextServiceAndFlagsEqual(okf *Config) bool

ContextServiceAndFlagsEqual determines if this instance is equal to the given instance with respect to context, server, and flag arguments.

func (*Config) GetManagerNamespace

func (kf *Config) GetManagerNamespace() string

type NamespaceListener

type NamespaceListener func(context.Context)

type Watcher

type Watcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Watcher watches some resource and can be cancelled

func NewWatcher

func NewWatcher(resource, namespace string, getter cache.Getter, objType runtime.Object, cond *sync.Cond, equals func(runtime.Object, runtime.Object) bool) *Watcher

func (*Watcher) Cancel

func (w *Watcher) Cancel()

func (*Watcher) Get

func (w *Watcher) Get(c context.Context, obj interface{}) (interface{}, bool, error)

func (*Watcher) HasSynced

func (w *Watcher) HasSynced() bool

HasSynced returns true if this Watcher's controller has synced, or if this watcher hasn't started yet

func (*Watcher) List

func (w *Watcher) List(c context.Context) []interface{}

func (*Watcher) Watch

func (w *Watcher) Watch(c context.Context, ready *sync.WaitGroup)

Jump to

Keyboard shortcuts

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