Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/common/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 2 additions & 0 deletions modules/common/statefulset/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Loading