Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Deployment and ReplicaSet timeout condition #193

Merged
merged 1 commit into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/kubernetes-deploy/kubernetes_resource/deployment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ def timeout_message
end

def deploy_timed_out?
if @progress
@progress["status"] == 'False'
else
super || @latest_rs && @latest_rs.deploy_timed_out?
end
@progress ? @progress["status"] == 'False' : super
end

def exists?
Expand Down
4 changes: 0 additions & 4 deletions lib/kubernetes-deploy/kubernetes_resource/replica_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ def timeout_message
@pods.map(&:timeout_message).compact.uniq.join("\n")
end

def deploy_timed_out?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most pragmatic reason is that @pods.all?(&:deploy_timed_out?) will never be true before super anyway, since the Pod timeout is double the RS timeout; this is just making the behaviour more difficult to understand with no real benefit. In fact, the Pod hard timeout was chosen based on the needs of bare pods, which are assumed to be running a single high-value pseudo-inline task, so referencing it from RS doesn't really make sense. Finally, the supported, k8s-native way to time out a deployment whose pods aren't rolling in time is using progressDeadlineSeconds.

super || @pods.present? && @pods.all?(&:deploy_timed_out?)
end

def exists?
@found
end
Expand Down