Skip to content

Commit

Permalink
Adjust logic for OnDelete STS Readiness
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmb committed Mar 8, 2022
1 parent c8dc4cc commit 6e8bf2b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/krane/kubernetes_resource/stateful_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def status
end

def deploy_succeeded?
success = observed_generation == current_generation &&
desired_replicas == status_data['readyReplicas'].to_i &&
status_data['currentRevision'] == status_data['updateRevision']
if update_strategy == ONDELETE
# Gem cannot monitor update since it doesn't occur until delete
unless @success_assumption_warning_shown
Expand All @@ -27,11 +30,10 @@ def deploy_succeeded?
"Consider switching to rollingUpdate.")
@success_assumption_warning_shown = true
end
else
success &= desired_replicas == status_data['currentReplicas'].to_i
end
observed_generation == current_generation &&
status_data['currentRevision'] == status_data['updateRevision'] &&
desired_replicas == status_data['readyReplicas'].to_i &&
desired_replicas == status_data['currentReplicas'].to_i
success
end

def deploy_failed?
Expand Down

0 comments on commit 6e8bf2b

Please sign in to comment.