Skip to content

Commit

Permalink
Squash
Browse files Browse the repository at this point in the history
  • Loading branch information
ayana-s committed Aug 3, 2023
1 parent 11ef9c2 commit 29e055c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/krane/kubernetes_resource/stateful_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Krane
class StatefulSet < PodSetBase
TIMEOUT = 10.minutes
ONDELETE = 'OnDelete'
SYNC_DEPENDENCIES = %w(Pod)
REQUIRED_ROLLOUT_TYPES = %w(full).freeze
attr_reader :pods
Expand Down Expand Up @@ -30,7 +31,7 @@ def deploy_succeeded?
success &= desired_replicas == status_data['readyReplicas'].to_i
success &= desired_replicas == status_data['currentReplicas'].to_i

elsif update_strategy == 'OnDelete'
elsif update_strategy == ONDELETE
unless @success_assumption_warning_shown
@logger.warn("WARNING: Your StatefulSet's updateStrategy is set to OnDelete, "\
"which means the deployment won't succeed until all pods are updated by deletion.")
Expand All @@ -47,7 +48,7 @@ def deploy_succeeded?
end

def deploy_failed?
return false if update_strategy == 'OnDelete' && required_rollout != 'full'
return false if update_strategy == ONDELETE && required_rollout != 'full'
pods.present? && pods.any?(&:deploy_failed?) &&
observed_generation == current_generation
end
Expand Down

0 comments on commit 29e055c

Please sign in to comment.