# Functions
DeploymentComplete considers a deployment to be complete once all of its desired replicas are updated and available, and no old pods are running.
DeploymentProgressing reports progress for a deployment.
DeploymentRolloutSatisfied return nil if deployment has satisfied partition and replicas, or will return an error.
DeploymentTimedOut considers a deployment to have timed out once its condition that reports progress is older than progressDeadlineSeconds or a Progressing condition with a TimedOutReason reason already exists.
EqualIgnoreHash returns true if two given podTemplateSpec are equal, ignoring the diff in value of Labels[pod-template-hash] We ignore pod-template-hash because: 1.
FilterActiveReplicaSets returns replica sets that have (or at least ought to have) pods.
FilterReplicaSets returns replica sets that are filtered by filterFn (all returned ones should match filterFn).
FindActiveOrLatest returns the only active or the latest replica set in case there is at most one active replica set.
FindNewReplicaSet returns the new RS this given deployment targets (the one with the same pod template).
FindOldReplicaSets returns the old replica sets targeted by the given Deployment, with the given slice of RSes.
GetActualReplicaCountForReplicaSets returns the sum of actual replicas of the given replica sets.
GetAvailableReplicaCountForReplicaSets returns the number of available pods corresponding to the given replica sets.
GetDeploymentCondition returns the condition with the provided type.
GetProportion will estimate the proportion for the provided replica set using 1.
GetReadyReplicaCountForReplicaSets returns the number of ready pods corresponding to the given replica sets.
GetReplicaCountForReplicaSets returns the sum of Replicas of the given replica sets.
GetReplicasAnnotation returns the number of desired replicas.
HasProgressDeadline checks if the Deployment d is expected to surface the reason "ProgressDeadlineExceeded" when the Deployment progress takes longer than expected time.
HasRevisionHistoryLimit checks if the Deployment d is expected to keep a specified number of old replicaSets.
IsRollingUpdate returns true if the strategy type is a rolling update.
IsSaturated checks if the new replica set is saturated by comparing its size with its deployment size.
IsUnderRolloutControl return true if this deployment should be controlled by our controller.
ListPods returns a list of pods the given deployment targets.
ListReplicaSets returns a slice of RSes the given deployment targets.
MaxRevision finds the highest revision in the replica sets.
MaxSurge returns the maximum surge pods a rolling deployment can take.
MaxUnavailable returns the maximum unavailable pods a rolling deployment can take.
MinAvailable returns the minimum available pods of a given deployment.
NewDeploymentCondition creates a new deployment condition.
NewRSNewReplicas calculates the number of replicas a deployment's new RS should have.
NewRSReplicasLimit return a limited replicas of new RS calculated via partition.
NewRSReplicasLowerBound ensure that newReplicasLowerBound is greater than 0 when create newRS unless deployment is 0 or MaxSurge > 0, this is because if we set new replicas as 0, the native deployment controller will flight with ours.
PodKey returns a key unique to the given pod within a cluster.
RemoveDeploymentCondition removes the deployment condition with the provided type.
ReplicasAnnotationsNeedUpdate return true if ReplicasAnnotations need to be updated.
ReplicaSetToDeploymentCondition converts a replica set condition into a deployment condition.
ResolveFenceposts resolves both maxSurge and maxUnavailable.
Revision returns the revision number of the input object.
SetDeploymentCondition updates the deployment to include the provided condition.
SetDeploymentRevision updates the revision for a deployment.
SetNewReplicaSetAnnotations sets new replica set's annotations appropriately by updating its revision and copying required deployment annotations to it; it returns true if replica set's annotation is changed.
SetReplicasAnnotations sets the desiredReplicas and maxReplicas into the annotations.
# Constants
FailedRSCreateReason is added in a deployment when it cannot create a new replica set.
FoundNewRSReason is added in a deployment when it adopts an existing replica set.
MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which is deployment.spec.replicas + maxSurge.
MinimumReplicasAvailable is added in a deployment when it has its minimum replicas required available.
MinimumReplicasUnavailable is added in a deployment when it doesn't have the minimum required replicas available.
NewReplicaSetReason is added in a deployment when it creates a new replica set.
NewRSAvailableReason is added in a deployment when its newest replica set is made available ie.
PausedDeployReason is added in a deployment when it is paused.
ReplicasAnnotation is the desired replicas for a deployment recorded as an annotation in its replica sets.
ReplicaSetUpdatedReason is added in a deployment when one of its replica sets is updated as part of the rollout process.
ResumedDeployReason is added in a deployment when it is resumed.
RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence.
RevisionHistoryAnnotation maintains the history of all old revisions that a replica set has served for a deployment.
TimedOutReason is added in a deployment when its newest replica set fails to show any progress within the given deadline (progressDeadlineSeconds).
# Type aliases
ControllersByCreationTimestamp sorts a list of ReplicationControllers by creation timestamp, using their names as a tie breaker.
ReplicaSetsByCreationTimestamp sorts a list of ReplicaSet by creation timestamp, using their names as a tie breaker.
ReplicaSetsByRevision sorts a list of ReplicaSet by revision, using their creation timestamp or name as a tie breaker.
ReplicaSetsBySizeNewer sorts a list of ReplicaSet by size in descending order, using their creation timestamp or name as a tie breaker.
ReplicaSetsBySizeOlder sorts a list of ReplicaSet by size in descending order, using their creation timestamp or name as a tie breaker.
ReplicaSetsBySmallerRevision sorts a list of ReplicaSet by revision in desc, using their creation timestamp or name as a tie breaker.
RsListFunc returns the ReplicaSet from the ReplicaSet namespace and the List metav1.ListOptions.