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

Emitting only tasks that pass all health checks #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ashwanthkumar
Copy link
Contributor

No description provided.

@@ -24,10 +24,15 @@ def all_apps_on(marathon_uri):
app_ids = map(lambda app: app["id"].strip("/"), apps)
return app_ids

def is_healthy_task(task):
result = len(filter(lambda healthCheck: not healthCheck["alive"], task["healthCheckResults"])) == 0
return bool(result)
Copy link
Owner

Choose a reason for hiding this comment

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

Do we need this? If not, the comparison can be inlined into return statement itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix that, I didn't know if I had to wrap it around bool or not.

@brewkode
Copy link
Owner

As an aside, it would've been better to allow MarathonTaskInfo to say if the task is alive or not instead of the main program doing it.

@ashwanthkumar
Copy link
Contributor Author

I was thinking, would MarathonTaskInfo ever need to know non-healthy tasks for an app? On the consul world when you query you get only the active (healthy) entires by default, but that doesn't seem to be case on the marathon world atleast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants