Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Add pod readiness check #5595

Closed
wants to merge 1 commit into from
Closed

Add pod readiness check #5595

wants to merge 1 commit into from

Conversation

yongk802
Copy link
Contributor

Previously, this was not checking for pod readiness, only that the pod was running. This takes care of that.

@fusesource-ci
Copy link
Contributor

Can one of the admins verify this patch?

// Check "ready" conditions
for (PodCondition condition : conditions) {
if ("ready".equalsIgnoreCase(condition.getType())) {
if (!"true".equalsIgnoreCase(condition.getStatus())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can just return Boolean.parseBoolean(condition.getStatus())?

@jimmidyson
Copy link
Contributor

LGTM with one minor tweak. Thanks!

@yongk802
Copy link
Contributor Author

Thanks for taking a look so quickly! I took a look at your suggestion. The reason it is the way it is, is because there may be a chance that there are multiple "Ready" and/or multiple "PodConditions" and I need to go through all of them without breaking out unless it finds one which is false. If I were to just return with the parseBoolean method, it may return a false positive as there may be other "PodConditions" which are not "Ready."

For example, say there's two "Ready" "PodConitions" in the list: one false and one true. If the parseBoolean method found the true one first, this method would break out of the loop and return true when in reality, there is still one PodCondition that is false. Or perhaps I misunderstood what you wanted changed. Let me know, thanks!

@jimmidyson
Copy link
Contributor

I didn't know that you could have multiple ready conditions. Can you link to where that's either documented or show where it happens in kubernetes code base?

@yongk802
Copy link
Contributor Author

I was thinking it was possible to have multiple readinessProbes if not now, in the future. However, it looks like if you try to do multiple readinessProbes, it will complain about the configuration, so it seems you can indeed only have one readinessProbe. I'll go ahead and make this update.

@yongk802
Copy link
Contributor Author

The update has been made.

@jimmidyson
Copy link
Contributor

Brilliant thanks. LGTM

@jimmidyson
Copy link
Contributor

OK to test

@jimmidyson
Copy link
Contributor

Merged by PR CI build. Thanks!

@jimmidyson jimmidyson closed this Jan 13, 2016
@yongk802 yongk802 deleted the feature/arquillian-readiness branch January 15, 2016 22:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants