k8sutil

package
v4.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerInPod

func ContainerInPod(pod *v1.Pod, containerName string) *v1.Container

ContainerInPod returns a reference to a container object given its name in the given pod. Returns nil if the container does not exist in the given pod.

func EnvValueForContainer

func EnvValueForContainer(pod *v1.Pod, envName, containerName string) (string, error)

EnvValueForContainer returns the value of an env var set on a container within a pod. It only supports simple env values and not value references.

func FetchSecretValue

func FetchSecretValue(client *k8s.Clientset, secretName, dataKey, namespace string) (string, error)

FetchSecretValue fetches a specific secret value from the "data" object in a secret and returns the decoded value.

func PortByName

func PortByName(pod *v1.Pod, port string) *v1.ContainerPort

PortByName returns the first port instance with the given name among all of a pod's containers. Returns nil if no port name matches.

func PortByNumber

func PortByNumber(pod *v1.Pod, port int32) *v1.ContainerPort

PortByNumber returns the first port instance, regardless of whether it is TCP or UDP, with the given port number among all of a pod's containers. Returns nil if no port number matches.

Types

type FixedFakeCustomStore

type FixedFakeCustomStore struct {
	cache.FakeCustomStore
}

FixedFakeCustomStore is necessary until we use a client-go version that includes https://github.com/kubernetes/kubernetes/pull/62406.

func (*FixedFakeCustomStore) Update

func (f *FixedFakeCustomStore) Update(obj interface{}) error

Update calls the custom Update function if defined

Jump to

Keyboard shortcuts

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