Skip to content

Commit

Permalink
Update sucess logic
Browse files Browse the repository at this point in the history
  • Loading branch information
karanthukral committed Oct 12, 2017
1 parent ee55396 commit 0d8cd38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/kubernetes-deploy/kubernetes_resource/stateful_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def sync

if @found
stateful_data = JSON.parse(raw_json)
@current_generation = stateful_data["metadata"]["generation"]
@observed_generation = stateful_data["status"]["observedGeneration"]
@desired_replicas = stateful_data["spec"]["replicas"].to_i
@rollout_data = stateful_data["status"].slice("replicas")
@status = @rollout_data.map { |state_replicas, num| "#{num} #{state_replicas.chop.pluralize(num)}" }.join(", ")
Expand All @@ -21,7 +23,7 @@ def sync
end

def deploy_succeeded?
@desired_replicas == @rollout_data["replicas"].to_i
@current_generation == @observed_generation && @desired_replicas == @rollout_data["replicas"].to_i
end

def deploy_failed?
Expand Down

0 comments on commit 0d8cd38

Please sign in to comment.