Documentation ¶
Index ¶
- Constants
- Variables
- func ActiveDeployment(input []*api.ReplicationController) *api.ReplicationController
- func ActiveDeploymentV1(input []*v1.ReplicationController) *v1.ReplicationController
- func AnyDeployerPodSelector() labels.Selector
- func CanTransitionPhase(current, next deployapi.DeploymentStatus) bool
- func ConfigSelector(name string) labels.Selector
- func CopyApiEnvVarToV1EnvVar(in []api.EnvVar) []v1.EnvVar
- func CopyApiResourcesToV1Resources(in *api.ResourceRequirements) v1.ResourceRequirements
- func DecodeDeploymentConfig(controller runtime.Object, decoder runtime.Decoder) (*deployapi.DeploymentConfig, error)
- func DeployerPodNameFor(obj runtime.Object) string
- func DeployerPodNameForDeployment(deployment string) string
- func DeployerPodSelector(name string) labels.Selector
- func DeploymentConfigDeepCopy(dc *deployapi.DeploymentConfig) (*deployapi.DeploymentConfig, error)
- func DeploymentConfigNameFor(obj runtime.Object) string
- func DeploymentDeepCopy(rc *api.ReplicationController) (*api.ReplicationController, error)
- func DeploymentDeepCopyV1(rc *v1.ReplicationController) (*v1.ReplicationController, error)
- func DeploymentDesiredReplicas(obj runtime.Object) (int32, bool)
- func DeploymentNameFor(obj runtime.Object) string
- func DeploymentNameForConfigVersion(name string, version int64) string
- func DeploymentReplicas(obj runtime.Object) (int32, bool)
- func DeploymentStatusFor(obj runtime.Object) deployapi.DeploymentStatus
- func DeploymentStatusReasonFor(obj runtime.Object) string
- func DeploymentVersionFor(obj runtime.Object) int64
- func DeploymentsForCleanup(configuration *deployapi.DeploymentConfig, ...) []v1.ReplicationController
- func EncodeDeploymentConfig(config *deployapi.DeploymentConfig, codec runtime.Codec) (string, error)
- func EncodedDeploymentConfigFor(obj runtime.Object) string
- func GetAvailableReplicaCountForReplicationControllers(replicationControllers []*v1.ReplicationController) int32
- func GetDeploymentCondition(status deployapi.DeploymentConfigStatus, ...) *deployapi.DeploymentCondition
- func GetReadyReplicaCountForReplicationControllers(replicationControllers []*v1.ReplicationController) int32
- func GetReplicaCountForDeployments(deployments []*v1.ReplicationController) int32
- func GetStatusReplicaCountForDeployments(deployments []*v1.ReplicationController) int32
- func HasChangeTrigger(config *deployapi.DeploymentConfig) bool
- func HasImageChangeTrigger(config *deployapi.DeploymentConfig) bool
- func HasSynced(dc *deployapi.DeploymentConfig, generation int64) bool
- func IsCompleteDeployment(deployment runtime.Object) bool
- func IsDeploymentCancelled(deployment runtime.Object) bool
- func IsFailedDeployment(deployment runtime.Object) bool
- func IsOwnedByConfig(obj metav1.Object) bool
- func IsProgressing(config *deployapi.DeploymentConfig, ...) bool
- func IsRollingConfig(config *deployapi.DeploymentConfig) bool
- func IsTerminatedDeployment(deployment runtime.Object) bool
- func LabelForDeployment(deployment *api.ReplicationController) string
- func LabelForDeploymentConfig(config *deployapi.DeploymentConfig) string
- func LabelForDeploymentV1(deployment *v1.ReplicationController) string
- func LatestDeploymentInfo(config *deployapi.DeploymentConfig, deployments []*v1.ReplicationController) (bool, *v1.ReplicationController)
- func LatestDeploymentNameForConfig(config *deployapi.DeploymentConfig) string
- func MakeDeployment(config *deployapi.DeploymentConfig, codec runtime.Codec) (*api.ReplicationController, error)
- func MakeDeploymentV1(config *deployapi.DeploymentConfig, codec runtime.Codec) (*v1.ReplicationController, error)
- func MaxSurge(config deployapi.DeploymentConfig) int32
- func MaxUnavailable(config *deployapi.DeploymentConfig) int32
- func NewControllerRef(config *deployapi.DeploymentConfig) *metav1.OwnerReference
- func NewDeploymentCondition(condType deployapi.DeploymentConditionType, status api.ConditionStatus, ...) *deployapi.DeploymentCondition
- func RemoveDeploymentCondition(status *deployapi.DeploymentConfigStatus, ...)
- func SetDeploymentCondition(status *deployapi.DeploymentConfigStatus, ...)
- func WaitForRunningDeployerPod(podClient kcoreclient.PodsGetter, rc *api.ReplicationController, ...) error
- type ByLatestVersionAsc
- type ByLatestVersionAscV1
- type ByLatestVersionDesc
- type ByLatestVersionDescV1
- type ByMostRecent
Constants ¶
const DeployerPodSuffix = "deploy"
DeployerPodSuffix is the suffix added to pods created from a deployment
Variables ¶
var ( // DeploymentConfigControllerRefKind contains the schema.GroupVersionKind for the // deployment config. This is used in the ownerRef and GC client picks the appropriate // client to get the deployment config. DeploymentConfigControllerRefKind = deployapiv1.SchemeGroupVersion.WithKind("DeploymentConfig") )
Functions ¶
func ActiveDeployment ¶
func ActiveDeployment(input []*api.ReplicationController) *api.ReplicationController
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 ActiveDeploymentV1 ¶
func ActiveDeploymentV1(input []*v1.ReplicationController) *v1.ReplicationController
ActiveDeploymentV1 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 ¶
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 ¶
func CanTransitionPhase(current, next deployapi.DeploymentStatus) bool
CanTransitionPhase returns whether it is allowed to go from the current to the next phase.
func ConfigSelector ¶
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 CopyApiResourcesToV1Resources ¶
func CopyApiResourcesToV1Resources(in *api.ResourceRequirements) v1.ResourceRequirements
func DecodeDeploymentConfig ¶
func DecodeDeploymentConfig(controller runtime.Object, 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 DeployerPodNameForDeployment ¶
DeployerPodNameForDeployment returns the name of a pod for a given deployment
func DeployerPodSelector ¶
DeployerPodSelector returns a label Selector which can be used to find all deployer pods associated with a deployment with name.
func DeploymentConfigDeepCopy ¶
func DeploymentConfigDeepCopy(dc *deployapi.DeploymentConfig) (*deployapi.DeploymentConfig, error)
func DeploymentConfigNameFor ¶
func DeploymentDeepCopy ¶
func DeploymentDeepCopy(rc *api.ReplicationController) (*api.ReplicationController, error)
func DeploymentDeepCopyV1 ¶
func DeploymentDeepCopyV1(rc *v1.ReplicationController) (*v1.ReplicationController, error)
func DeploymentNameFor ¶
func DeploymentNameForConfigVersion ¶
DeploymentNameForConfigVersion returns the name of the version-th deployment for the config that has the provided name
func DeploymentStatusFor ¶
func DeploymentStatusFor(obj runtime.Object) deployapi.DeploymentStatus
func DeploymentVersionFor ¶
func DeploymentsForCleanup ¶
func DeploymentsForCleanup(configuration *deployapi.DeploymentConfig, deployments []*v1.ReplicationController) []v1.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 GetAvailableReplicaCountForReplicationControllers ¶
func GetAvailableReplicaCountForReplicationControllers(replicationControllers []*v1.ReplicationController) int32
GetAvailableReplicaCountForReplicationControllers returns the number of available pods corresponding to the given replication controller.
func GetDeploymentCondition ¶
func GetDeploymentCondition(status deployapi.DeploymentConfigStatus, condType deployapi.DeploymentConditionType) *deployapi.DeploymentCondition
GetDeploymentCondition returns the condition with the provided type.
func GetReadyReplicaCountForReplicationControllers ¶
func GetReadyReplicaCountForReplicationControllers(replicationControllers []*v1.ReplicationController) int32
GetReadyReplicaCountForReplicationControllers returns the number of ready pods corresponding to the given replication controller.
func GetReplicaCountForDeployments ¶
func GetReplicaCountForDeployments(deployments []*v1.ReplicationController) int32
GetReplicaCountForDeployments returns the sum of all replicas for the given deployments.
func GetStatusReplicaCountForDeployments ¶
func GetStatusReplicaCountForDeployments(deployments []*v1.ReplicationController) int32
GetStatusReplicaCountForDeployments returns the sum of the replicas reported in the status of the given deployments.
func HasChangeTrigger ¶
func HasChangeTrigger(config *deployapi.DeploymentConfig) bool
HasChangeTrigger returns whether the provided deployment configuration has a config change trigger or not
func HasImageChangeTrigger ¶
func HasImageChangeTrigger(config *deployapi.DeploymentConfig) bool
HasImageChangeTrigger returns whether the provided deployment configuration has an image change trigger or not.
func HasSynced ¶
func HasSynced(dc *deployapi.DeploymentConfig, generation int64) bool
HasSynced checks if the provided deployment config has been noticed by the deployment config controller.
func IsCompleteDeployment ¶
IsCompleteDeployment returns true if the passed deployment is in state complete.
func IsDeploymentCancelled ¶
func IsFailedDeployment ¶
IsFailedDeployment returns true if the passed deployment failed.
func IsOwnedByConfig ¶
IsOwnedByConfig checks whether the provided replication controller is part of a deployment configuration. TODO: Switch to use owner references once we got those working.
func IsProgressing ¶
func IsProgressing(config *deployapi.DeploymentConfig, newStatus *deployapi.DeploymentConfigStatus) bool
IsProgressing expects a state deployment config and its updated status in order to determine if there is any progress.
func IsRollingConfig ¶
func IsRollingConfig(config *deployapi.DeploymentConfig) bool
IsRollingConfig returns true if the strategy type is a rolling update.
func IsTerminatedDeployment ¶
IsTerminatedDeployment returns true if the passed deployment has terminated (either complete or failed).
func LabelForDeployment ¶
func LabelForDeployment(deployment *api.ReplicationController) string
LabelForDeployment builds a string identifier for a Deployment.
func LabelForDeploymentConfig ¶
func LabelForDeploymentConfig(config *deployapi.DeploymentConfig) string
LabelForDeploymentConfig builds a string identifier for a DeploymentConfig.
func LabelForDeploymentV1 ¶
func LabelForDeploymentV1(deployment *v1.ReplicationController) string
LabelForDeployment builds a string identifier for a Deployment.
func LatestDeploymentInfo ¶
func LatestDeploymentInfo(config *deployapi.DeploymentConfig, deployments []*v1.ReplicationController) (bool, *v1.ReplicationController)
LatestDeploymentInfo returns info about the latest deployment for a config, or nil if there is no latest deployment. The latest deployment is not always the same as the active deployment.
func LatestDeploymentNameForConfig ¶
func LatestDeploymentNameForConfig(config *deployapi.DeploymentConfig) string
LatestDeploymentNameForConfig returns a stable identifier for config based on its version.
func MakeDeployment ¶
func MakeDeployment(config *deployapi.DeploymentConfig, codec runtime.Codec) (*api.ReplicationController, error)
MakeDeployment creates a deployment represented as an internal ReplicationController and based on the given DeploymentConfig. The controller replica count will be zero. DEPRECATED: Will be replaced with external version eventually.
func MakeDeploymentV1 ¶
func MakeDeploymentV1(config *deployapi.DeploymentConfig, codec runtime.Codec) (*v1.ReplicationController, error)
MakeDeploymentV1 creates a deployment represented as a ReplicationController and based on the given DeploymentConfig. The controller replica count will be zero.
func MaxSurge ¶
func MaxSurge(config deployapi.DeploymentConfig) int32
MaxSurge returns the maximum surge pods a rolling deployment config can take.
func MaxUnavailable ¶
func MaxUnavailable(config *deployapi.DeploymentConfig) int32
MaxUnavailable returns the maximum unavailable pods a rolling deployment config can take.
func NewControllerRef ¶
func NewControllerRef(config *deployapi.DeploymentConfig) *metav1.OwnerReference
func NewDeploymentCondition ¶
func NewDeploymentCondition(condType deployapi.DeploymentConditionType, status api.ConditionStatus, reason deployapi.DeploymentConditionReason, message string) *deployapi.DeploymentCondition
NewDeploymentCondition creates a new deployment condition.
func RemoveDeploymentCondition ¶
func RemoveDeploymentCondition(status *deployapi.DeploymentConfigStatus, condType deployapi.DeploymentConditionType)
RemoveDeploymentCondition removes the deployment condition with the provided type.
func SetDeploymentCondition ¶
func SetDeploymentCondition(status *deployapi.DeploymentConfigStatus, condition deployapi.DeploymentCondition)
SetDeploymentCondition updates the deployment to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.
func WaitForRunningDeployerPod ¶
func WaitForRunningDeployerPod(podClient kcoreclient.PodsGetter, rc *api.ReplicationController, timeout time.Duration) error
WaitForRunningDeployerPod waits a given period of time until the deployer pod for given replication controller is not running.
Types ¶
type ByLatestVersionAsc ¶
type ByLatestVersionAsc []*api.ReplicationController
ByLatestVersionAsc sorts deployments by LatestVersion ascending.
func (ByLatestVersionAsc) Len ¶
func (d ByLatestVersionAsc) Len() int
func (ByLatestVersionAsc) Less ¶
func (d ByLatestVersionAsc) Less(i, j int) bool
func (ByLatestVersionAsc) Swap ¶
func (d ByLatestVersionAsc) Swap(i, j int)
type ByLatestVersionAscV1 ¶
type ByLatestVersionAscV1 []*v1.ReplicationController
func (ByLatestVersionAscV1) Len ¶
func (d ByLatestVersionAscV1) Len() int
func (ByLatestVersionAscV1) Less ¶
func (d ByLatestVersionAscV1) Less(i, j int) bool
func (ByLatestVersionAscV1) Swap ¶
func (d ByLatestVersionAscV1) Swap(i, j int)
type ByLatestVersionDesc ¶
type ByLatestVersionDesc []*api.ReplicationController
ByLatestVersionDesc sorts deployments by LatestVersion descending.
func (ByLatestVersionDesc) Len ¶
func (d ByLatestVersionDesc) Len() int
func (ByLatestVersionDesc) Less ¶
func (d ByLatestVersionDesc) Less(i, j int) bool
func (ByLatestVersionDesc) Swap ¶
func (d ByLatestVersionDesc) Swap(i, j int)
type ByLatestVersionDescV1 ¶
type ByLatestVersionDescV1 []*v1.ReplicationController
ByLatestVersionDescV1 sorts deployments by LatestVersion descending.
func (ByLatestVersionDescV1) Len ¶
func (d ByLatestVersionDescV1) Len() int
func (ByLatestVersionDescV1) Less ¶
func (d ByLatestVersionDescV1) Less(i, j int) bool
func (ByLatestVersionDescV1) Swap ¶
func (d ByLatestVersionDescV1) Swap(i, j int)
type ByMostRecent ¶
type ByMostRecent []*api.ReplicationController
ByMostRecent sorts deployments by most recently created.
func (ByMostRecent) Len ¶
func (s ByMostRecent) Len() int
func (ByMostRecent) Less ¶
func (s ByMostRecent) Less(i, j int) bool
func (ByMostRecent) Swap ¶
func (s ByMostRecent) Swap(i, j int)