k8s

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyResource

func ApplyResource(f *cmdutil.Factory, c *client.Client, ns string, data []byte, name string) error

ApplyResource applies the given data as a kubernetes resource

func EnsureContainerHasEnvVar

func EnsureContainerHasEnvVar(container *api.Container, name string, value string) bool

EnsureContainerHasEnvVar if there is an existing EnvVar for the given name then lets update it with the given value otherwise lets add a new entry. Returns true if there was already an existing environment variable

func EnsureContainerHasEnvVarFromField

func EnsureContainerHasEnvVarFromField(container *api.Container, name string, fieldPath string) bool

EnsureContainerHasEnvVarFromField if there is an existing EnvVar for the given name then lets update it with the given fieldPath otherwise lets add a new entry. Returns true if there was already an existing environment variable

func EnsureContainerHasPreStopCommand

func EnsureContainerHasPreStopCommand(container *api.Container, commands []string)

EnsureContainerHasPreStopCommand ensures that the given container has a `preStop` lifecycle hook to invoke the given commands

func EnsureContainerHasVolumeMount

func EnsureContainerHasVolumeMount(container *api.Container, name string, mountPath string) bool

EnsureContainerHasVolumeMount ensures that there is a volume mount of the given name with the given values Returns true if there was already a volume mount

func EnsurePodSpecHasGitVolume

func EnsurePodSpecHasGitVolume(podSpec *api.PodSpec, name string, gitRepo string, gitRevision string) bool

EnsurePodSpecHasGitVolume ensures that there is a volume with the given name and git repo and revision

func EnsurePodSpecHasSecretVolume

func EnsurePodSpecHasSecretVolume(podSpec *api.PodSpec, name string, secretName string) bool

EnsurePodSpecHasSecretVolume ensures that there is a volume with the given name and secret

func EnsureServiceAccountExists

func EnsureServiceAccountExists(c *client.Client, ns string, serviceAccountName string) (bool, error)

EnsureServiceAccountExists ensures that there is a service account created for the given name

func GetContainerEnvVar

func GetContainerEnvVar(container *api.Container, name string) string

GetContainerEnvVar returns the environment variable value for the given name in the Container

func GetFirstContainerOrCreate

func GetFirstContainerOrCreate(rc *api.ReplicationController) *api.Container

GetFirstContainerOrCreate returns the first Container in the PodSpec for this ReplicationController lazily creating structures as required

func GetOrCreatePodSpec

func GetOrCreatePodSpec(rc *api.ReplicationController) *api.PodSpec

GetOrCreatePodSpec returns the PodSpec for this ReplicationController lazily creating structures as required

func GetThisPodName

func GetThisPodName() (string, error)

GetThisPodName returns this pod name via the `HOSTNAME` environment variable

func PodIsRunning

func PodIsRunning(pods *api.PodList, podName string) bool

PodIsRunning returns true if the given pod is running in the given list of all pods

func ReadReplicationController

func ReadReplicationController(data []byte) (*api.ReplicationController, error)

ReadReplicationController loads a ReplicationController from the given data

func ReadReplicationControllerFromFile

func ReadReplicationControllerFromFile(filename string) (*api.ReplicationController, error)

ReadReplicationControllerFromFile reads the ReplicationController object from the given file name

Types

This section is empty.

Jump to

Keyboard shortcuts

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