cluster

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotInCluster = errors.New("not running within a kubernetes cluster")

ErrNotInCluster is returned if the process is not running within a Kubernetes cluster.

Functions

func Namespace

func Namespace() (string, error)

Namespace returns the namespace that the current container is running in, if it is running within a Kubernetes cluster. If not, an error is returned.

Code slightly modified from: https://github.com/kubernetes-sigs/controller-runtime/blob/v0.8.3/pkg/leaderelection/leader_election.go#L104-L120

Types

This section is empty.

Jump to

Keyboard shortcuts

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