util

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DeployerPodSuffix = "deploy"

DeployerPodSuffix is the suffix added to pods created from a deployment

Variables

This section is empty.

Functions

func ActiveDeployment added in v1.1.1

ActiveDeployment returns the latest complete deployment, or nil if there is no such deployment. The active deployment is not always the same as the latest deployment.

func AnyDeployerPodSelector

func AnyDeployerPodSelector() labels.Selector

AnyDeployerPodSelector returns a label Selector which can be used to find all deployer pods across all deployments, including hook and custom deployer pods.

func CanTransitionPhase added in v1.2.0

func CanTransitionPhase(current, next deployapi.DeploymentStatus) bool

CanTransitionPhase returns whether it is allowed to go from the current to the next phase.

func ConfigSelector

func ConfigSelector(name string) labels.Selector

ConfigSelector returns a label Selector which can be used to find all deployments for a DeploymentConfig.

TODO: Using the annotation constant for now since the value is correct but we could consider adding a new constant to the public types.

func DecodeDeploymentConfig

func DecodeDeploymentConfig(controller *api.ReplicationController, decoder runtime.Decoder) (*deployapi.DeploymentConfig, error)

DecodeDeploymentConfig decodes a DeploymentConfig from controller using codec. An error is returned if the controller doesn't contain an encoded config.

func DeployerPodNameFor

func DeployerPodNameFor(obj runtime.Object) string

func DeployerPodNameForDeployment

func DeployerPodNameForDeployment(deployment string) string

DeployerPodNameForDeployment returns the name of a pod for a given deployment

func DeployerPodSelector

func DeployerPodSelector(name string) labels.Selector

DeployerPodSelector returns a label Selector which can be used to find all deployer pods associated with a deployment with name.

func DeploymentConfigDeepCopy added in v1.3.0

func DeploymentConfigDeepCopy(dc *deployapi.DeploymentConfig) (*deployapi.DeploymentConfig, error)

func DeploymentConfigNameFor

func DeploymentConfigNameFor(obj runtime.Object) string

func DeploymentDeepCopy added in v1.3.0

func DeploymentDeepCopy(rc *api.ReplicationController) (*api.ReplicationController, error)

func DeploymentDesiredReplicas

func DeploymentDesiredReplicas(obj runtime.Object) (int32, bool)

func DeploymentNameFor

func DeploymentNameFor(obj runtime.Object) string

func DeploymentNameForConfigVersion added in v1.0.7

func DeploymentNameForConfigVersion(name string, version int64) string

DeploymentNameForConfigVersion returns the name of the version-th deployment for the config that has the provided name

func DeploymentReplicas added in v1.1.1

func DeploymentReplicas(obj runtime.Object) (int32, bool)

func DeploymentStatusFor

func DeploymentStatusFor(obj runtime.Object) deployapi.DeploymentStatus

func DeploymentStatusReasonFor

func DeploymentStatusReasonFor(obj runtime.Object) string

func DeploymentVersionFor

func DeploymentVersionFor(obj runtime.Object) int64

func DeploymentsForCleanup added in v1.3.0

func DeploymentsForCleanup(configuration *deployapi.DeploymentConfig, deployments []api.ReplicationController) []api.ReplicationController

DeploymentsForCleanup determines which deployments for a configuration are relevant for the revision history limit quota

func EncodeDeploymentConfig

func EncodeDeploymentConfig(config *deployapi.DeploymentConfig, codec runtime.Codec) (string, error)

EncodeDeploymentConfig encodes config as a string using codec.

func EncodedDeploymentConfigFor

func EncodedDeploymentConfigFor(obj runtime.Object) string

func GetAvailablePods added in v1.3.0

func GetAvailablePods(pods []api.Pod, minReadySeconds int32) int32

GetAvailablePods returns all the available pods from the provided pod list.

func GetReplicaCountForDeployments added in v1.3.0

func GetReplicaCountForDeployments(deployments []api.ReplicationController) int32

GetReplicaCountForDeployments returns the sum of all replicas for the given deployments.

func GetStatusReplicaCountForDeployments added in v1.3.0

func GetStatusReplicaCountForDeployments(deployments []