Documentation ¶
Index ¶
- func ApplyResource(f *cmdutil.Factory, c *client.Client, ns string, data []byte, name string) error
- func EnsureContainerHasEnvVar(container *api.Container, name string, value string) bool
- func EnsureContainerHasEnvVarFromField(container *api.Container, name string, fieldPath string) bool
- func EnsureContainerHasPreStopCommand(container *api.Container, commands []string)
- func EnsureContainerHasVolumeMount(container *api.Container, name string, mountPath string) bool
- func EnsurePodSpecHasGitVolume(podSpec *api.PodSpec, name string, gitRepo string, gitRevision string) bool
- func EnsurePodSpecHasSecretVolume(podSpec *api.PodSpec, name string, secretName string) bool
- func EnsureServiceAccountExists(c *client.Client, ns string, serviceAccountName string) (bool, error)
- func GetContainerEnvVar(container *api.Container, name string) string
- func GetFirstContainerOrCreate(rc *api.ReplicationController) *api.Container
- func GetOrCreatePodSpec(rc *api.ReplicationController) *api.PodSpec
- func GetThisPodName() (string, error)
- func PodIsRunning(pods *api.PodList, podName string) bool
- func ReadReplicationController(data []byte) (*api.ReplicationController, error)
- func ReadReplicationControllerFromFile(filename string) (*api.ReplicationController, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyResource ¶
ApplyResource applies the given data as a kubernetes resource
func EnsureContainerHasEnvVar ¶
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 ¶
EnsureContainerHasPreStopCommand ensures that the given container has a `preStop` lifecycle hook to invoke the given commands
func EnsureContainerHasVolumeMount ¶
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 ¶
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 ¶
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 ¶
GetThisPodName returns this pod name via the `HOSTNAME` environment variable
func PodIsRunning ¶
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.