// TODO: remove the wrapper when every clients have moved to use the clientset.
// worker runs a worker thread that just dequeues items, processes them, and marks them done.
// It enforces that the syncHandler is never invoked concurrently with the same key.
// syncDeployment will sync the deployment with the given key.
// This function is not meant to be invoked concurrently with the same key.
// Deep-copy otherwise we are mutating our cache.
// TODO: Deep-copy only when needed.
// List all Pods owned by this Deployment, grouped by their ReplicaSet.
// * check if a Pod is labeled correctly with the pod-template-hash label.
// * check that no old Pods are running in the middle of Recreate Deployments.
// resumes a Deployment with a set progressDeadlineSeconds.
// make sure that the deployment has cleaned up its rollback spec in subsequent enqueues.
// ControllerRef by adopting and orphaning.
// It returns the list of ReplicaSets that this Deployment should manage.
// selector. They will be orphaned by ClaimReplicaSets().
// an uncached quorum read sometime after listing ReplicaSets (see #42639).
// getPodMapForDeployment returns the Pods managed by a Deployment.
// according to the Pod's ControllerRef.
// Get all Pods that potentially belong to this Deployment.
// Group Pods by their controller (if it's in rsList).
// Pods from older versions are running before spinning up new Pods.
// Only append if we care about this UID.
// checkPausedConditions checks if the given deployment is paused or not and adds an appropriate condition.
// that were paused for longer than progressDeadlineSeconds.
// If we have reported lack of progress, do not overwrite it with a paused condition.
// by looking at the desired-replicas annotation in the active replica sets of the deployment.
// rsList should come from getReplicaSetsForDeployment(d).
// podMap should come from getPodMapForDeployment(d, rsList).
// rolloutRecreate implements the logic for recreating a replica set.
// Don't create a new RS if not already existed, so that we avoid scaling up before scaling down.
// scale down old replica sets.
// Do not process a deployment when it has old pods running.
// If we need to create a new RS, create it now.
// scale up new replica set.
// rolloutRolling implements the logic for rolling a new replica set.
// Scale up, if we can.
// Scale down, if we can.