Skip to content

Commit e6e62be

Browse files
authored
Merge pull request #704 from lmiccini/transport-secret-consumer-finalizer
Require all pods updated before reporting IsReady
2 parents d3778a5 + 9fe3a4c commit e6e62be

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

modules/common/deployment/deployment.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,12 @@ func GetDeploymentWithName(
132132
// IsReady - validates when deployment is ready deployed to whats being requested
133133
// - the requested replicas in the spec matches the ReadyReplicas of the status
134134
// - the Status.Replicas match Status.ReadyReplicas. if a deployment update is in progress, Replicas > ReadyReplicas
135+
// - all pods run the current spec (UpdatedReplicas == requested replicas)
135136
// - both when the Generatation of the object matches the ObservedGeneration of the Status
136137
func IsReady(deployment appsv1.Deployment) bool {
137138
return deployment.Spec.Replicas != nil &&
138139
*deployment.Spec.Replicas == deployment.Status.ReadyReplicas &&
140+
*deployment.Spec.Replicas == deployment.Status.UpdatedReplicas &&
139141
deployment.Status.Replicas == deployment.Status.ReadyReplicas &&
140142
deployment.Generation == deployment.Status.ObservedGeneration
141143
}

modules/common/statefulset/statefulset.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,11 @@ func (s *StatefulSet) Delete(
152152

153153
// IsReady - validates when deployment is ready deployed to whats being requested
154154
// - the requested replicas in the spec matches the ReadyReplicas of the status
155+
// - all pods run the current spec (UpdatedReplicas == requested replicas)
155156
// - both when the Generatation of the object matches the ObservedGeneration of the Status
156157
func IsReady(deployment appsv1.StatefulSet) bool {
157158
return deployment.Spec.Replicas != nil &&
158159
*deployment.Spec.Replicas == deployment.Status.ReadyReplicas &&
160+
*deployment.Spec.Replicas == deployment.Status.UpdatedReplicas &&
159161
deployment.Generation == deployment.Status.ObservedGeneration
160162
}

0 commit comments

Comments
 (0)