# Functions

CloneAndAddLabel clones the given map and returns a new map with the given key and value added.
CloneSelectorAndAddLabel clones the given selector and returns a new selector with the given key and value added.
ComputeHash computes the hash of a MachineTemplateSpec using the spew library.
ComputeSpewHash computes the hash of a MachineTemplateSpec using the spew library.
DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.
DeploymentComplete considers a deployment to be complete once all of its desired replicas are updated and available, and no old machines are running.
EqualMachineTemplate returns true if two given machineTemplateSpec are equal, ignoring the diff in value of Labels["machine-template-hash"], and the version from external references.
FilterActiveMachineSets returns machine sets that have (or at least ought to have) machines.
FilterMachineSets returns machine sets that are filtered by filterFn (all returned ones should match filterFn).
FindNewMachineSet returns the new MS this given deployment targets (the one with the same machine template).
FindOldMachineSets returns the old machine sets targeted by the given Deployment, with the given slice of MSes.
FindOneActiveOrLatest returns the only active or the latest machine set in case there is at most one active machine set.
GetActualReplicaCountForMachineSets returns the sum of actual replicas of the given machine sets.
GetAvailableReplicaCountForMachineSets returns the number of available machines corresponding to the given machine sets.
GetDeletingMachineCount gets the number of machines that are in the process of being deleted in a machineList.
GetProportion will estimate the proportion for the provided machine set using 1.
GetReadyReplicaCountForMachineSets returns the number of ready machines corresponding to the given machine sets.
GetReplicaCountForMachineSets returns the sum of Replicas of the given machine sets.
IsRollingUpdate returns true if the strategy type is a rolling update.
IsSaturated checks if the new machine set is saturated by comparing its size with its deployment size.
MaxRevision finds the highest revision in the machine sets.
MaxSurge returns the maximum surge machines a rolling deployment can take.
MaxUnavailable returns the maximum unavailable machines a rolling deployment can take.
NewMSNewReplicas calculates the number of replicas a deployment's new MS should have.
ReplicasAnnotationsNeedUpdate return true if the replicas annotation needs to be updated.
ResolveFenceposts resolves both maxSurge and maxUnavailable.
Revision returns the revision number of the input object.
SetDeploymentRevision updates the revision for a deployment.
SetNewMachineSetAnnotations sets new machine set's annotations appropriately by updating its revision and copying required deployment annotations to it; it returns true if machine set's annotation is changed.
SetReplicasAnnotations sets the desiredReplicas and maxReplicas into the annotations.
SpewHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.
TotalMachineSetsReplicaSum returns sum of max(ms.Spec.Replicas, ms.Status.Replicas) across all the machine sets.

# Constants

DefaultMachineDeploymentUniqueLabelKey is the label applied to Machines in a MachineDeployment containing the hash of the template.
FailedMSCreateReason is added in a machine deployment when it cannot create a new machine set.
FoundNewMSReason is added in a machine deployment when it adopts an existing machine set.
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.
PausedDeployReason is added in a deployment when it is paused.

# Type aliases

MachineSetsByCreationTimestamp sorts a list of MachineSet by creation timestamp, using their names as a tie breaker.
MachineSetsBySizeNewer sorts a list of MachineSet by size in descending order, using their creation timestamp or name as a tie breaker.
MachineSetsBySizeOlder sorts a list of MachineSet by size in descending order, using their creation timestamp or name as a tie breaker.