diff --git a/lib/krane/kubernetes_resource/stateful_set.rb b/lib/krane/kubernetes_resource/stateful_set.rb index ff579e768..4f06d7029 100644 --- a/lib/krane/kubernetes_resource/stateful_set.rb +++ b/lib/krane/kubernetes_resource/stateful_set.rb @@ -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 @@ -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.") @@ -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