kubernetes

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEnvVarNotFound = errors.New("env var not found")
View Source
var ErrNoEnvNames = errors.New("dialect does not contain any env names")
View Source
var ErrNoPods = errors.New("no pods in namespace")
View Source
var ErrPodNotFound = errors.New("no pods with matching label")
View Source
var ErrSecretDoesNotHaveKey = errors.New("secret does not have key")

Functions

func FindEnvVar

func FindEnvVar(pod v1.Pod, envName string) (*v1.EnvVar, error)

func NewConfigLoader added in v1.4.3

func NewConfigLoader(kubeconfigPath, context string) clientcmd.ClientConfig

func RawConfig

func RawConfig(kubeconfigPath string) (api.Config, error)

Types

type KubeClient

type KubeClient struct {
	ClientSet    kubernetes.Interface
	ClientConfig *rest.Config
	Namespace    string
}

func NewClient

func NewClient(kubeconfigPath, context, namespace string) (config KubeClient, err error)

func NewClientFromCmd

func NewClientFromCmd(cmd *cobra.Command) (KubeClient, error)

func (KubeClient) Exec

func (client KubeClient) Exec(pod v1.Pod, cmd string, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue remotecommand.TerminalSizeQueue) error

func (KubeClient) FilterPodList

func (client KubeClient) FilterPodList(pods *v1.PodList, queries []LabelQueryable) (foundPods []v1.Pod, err error)

func (KubeClient) GetNamespacedPods

func (client KubeClient) GetNamespacedPods() (*v1.PodList, error)

func (KubeClient) GetPodsFiltered

func (client KubeClient) GetPodsFiltered(queries []LabelQueryable) ([]v1.Pod, error)

func (KubeClient) GetValueFromEnv

func (client KubeClient) GetValueFromEnv(pod v1.Pod, envNames []string) (string, error)

func (KubeClient) Namespaces

func (client KubeClient) Namespaces() v1.NamespaceInterface

func (KubeClient) Pods

func (client KubeClient) Pods() v1.PodInterface

func (KubeClient) Secrets

func (client KubeClient) Secrets() v1.SecretInterface

type LabelQuery

type LabelQuery struct {
	Name  string
	Value string
}

func (LabelQuery) FindPods

func (query LabelQuery) FindPods(list *v1.PodList) (pods []v1.Pod, err error)

func (LabelQuery) Matches

func (query LabelQuery) Matches(pod v1.Pod) bool

type LabelQueryAnd

type LabelQueryAnd []LabelQuery

func (LabelQueryAnd) FindPods

func (queries LabelQueryAnd) FindPods(list *v1.PodList) (pods []v1.Pod, err error)

func (LabelQueryAnd) Matches

func (queries LabelQueryAnd) Matches(pod v1.Pod) bool

type LabelQueryable

type LabelQueryable interface {
	Matches(pod v1.Pod) bool
	FindPods(list *v1.PodList) ([]v1.Pod, error)
}

Jump to

Keyboard shortcuts

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