Repository navigation
Conversation
Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
Container running in attached mode returns a JSON string for its exit code rather than just 0. Updated acceptance test to match this behavior Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
May fix the changes in another PR Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
I fat fingered a line in my first commit, this commit changes that to match current master. Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
|
Tested today, works very good with or without containers that have a healthcheck status |
shin-
left a comment
There was a problem hiding this comment.
Thanks! Just mentioned a couple small improvements, otherwise this is good. Can you squash your commits as well?
| return not log_type or log_type in ('json-file', 'journald') | ||
|
|
||
| @property | ||
| def create_health_status_string(self): |
There was a problem hiding this comment.
If a method is marked with an @property decorator, it should have a property name instead of an action name. To be consistent with other similar properties, maybe rename this to human_readable_health_status?
| """ | ||
| status_string = 'Up' | ||
| if 'Health' in self.get('State'): | ||
| container_status = self.get('State.Health.Status') |
There was a problem hiding this comment.
Because get will return None if the key is undefined, you can simplify this part of the code by writing
container_status = self.get('State.Health.Status')
if container_status == 'starting':
...
elif container_status is not None:
...Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
…compose into 5525-ps-show-health
|
Please sign your commits following these rules: $ git clone -b "5525-ps-show-health" git@github.com:dihmuzikien/compose.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354332872
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
…compose into 5525-ps-show-health Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
|
@shin- I made changes as requested. But I haven't able to figure out how to squash my commits (sorry, still a newbie). |
Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com> Add health string generator. Works like DockerCLI Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com> Add unittests for healthy, starting, none case Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com> Update test to use JSON status Container running in attached mode returns a JSON string for its exit code rather than just 0. Updated acceptance test to match this behavior Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com> Rollback previous changes. May fix the changes in another PR Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com> Fixed accidental changes causing fail tests I fat fingered a line in my first commit, this commit changes that to match current master. Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com> Rename health string property and made changes as requested Signed-off-by: Sorawis Nilparuk <turbo2547@hotmail.com>
…compose into 5525-ps-show-health
|
@dihmuzikien Thank you! I'll take care of rebasing / squashing things together. |
|
Merged in bb16d9e Thank you! |
Add health string to
docker-compose psoutput. The command behaves like Docker CLI For startingUp (health: starting)For no health check
UpFor healthy or unhealthy
Up (healthy/unhealthy)