diff --git a/modules/common/deployment/deployment.go b/modules/common/deployment/deployment.go index 5fa3baa8..cae6daf9 100644 --- a/modules/common/deployment/deployment.go +++ b/modules/common/deployment/deployment.go @@ -132,10 +132,12 @@ func GetDeploymentWithName( // IsReady - validates when deployment is ready deployed to whats being requested // - the requested replicas in the spec matches the ReadyReplicas of the status // - the Status.Replicas match Status.ReadyReplicas. if a deployment update is in progress, Replicas > ReadyReplicas +// - all pods run the current spec (UpdatedReplicas == requested replicas) // - both when the Generatation of the object matches the ObservedGeneration of the Status func IsReady(deployment appsv1.Deployment) bool { return deployment.Spec.Replicas != nil && *deployment.Spec.Replicas == deployment.Status.ReadyReplicas && + *deployment.Spec.Replicas == deployment.Status.UpdatedReplicas && deployment.Status.Replicas == deployment.Status.ReadyReplicas && deployment.Generation == deployment.Status.ObservedGeneration } diff --git a/modules/common/statefulset/statefulset.go b/modules/common/statefulset/statefulset.go index 04fe21c2..9f87a2a8 100644 --- a/modules/common/statefulset/statefulset.go +++ b/modules/common/statefulset/statefulset.go @@ -152,9 +152,11 @@ func (s *StatefulSet) Delete( // IsReady - validates when deployment is ready deployed to whats being requested // - the requested replicas in the spec matches the ReadyReplicas of the status +// - all pods run the current spec (UpdatedReplicas == requested replicas) // - both when the Generatation of the object matches the ObservedGeneration of the Status func IsReady(deployment appsv1.StatefulSet) bool { return deployment.Spec.Replicas != nil && *deployment.Spec.Replicas == deployment.Status.ReadyReplicas && + *deployment.Spec.Replicas == deployment.Status.UpdatedReplicas && deployment.Generation == deployment.Status.ObservedGeneration }