code: func WaitForObservedDeployment(getDeploymentFunc func() (*apps.Deployment, error), desiredGeneration int64, interval, timeout time.Duration) error {
  	// TODO: This should take clientset.Interface when all code is updated to use clientset. Keeping it this way allows the function to be used by callers who have client.Interface.
  	return wait.PollImmediate(interval, timeout, func() (bool, error) {
  		deployment, err := getDeploymentFunc()
  		if err != nil {
  			return false, err
  		}
  		return deployment.Status.ObservedGeneration >= desiredGeneration, nil
  	})
  }
docs: // WaitForObservedDeployment polls for deployment to be updated so that deployment.Status.ObservedGeneration >= desiredGeneration.
  // Returns error if polling timesout.