-
Notifications
You must be signed in to change notification settings - Fork 116
show fault domain in node and task subcommand output #1068
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment otherwise LGTM
dcos/util.py
Outdated
:param state: mesos state json top level or a node item | ||
:type state: dict | ||
:returns: region and zone | ||
:rtype: str | None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this returns a tuple and not a single value, should this be :rtype: (str | None, str | None)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
get_fault_domain takes a state json top level or an agent dict and returns a fault domain attributes: region and zone.
add fields: REGION, ZONE example: $ dcos node HOSTNAME IP ID TYPE REGION ZONE 10.0.2.140 10.0.2.140 446f21c5-2124-4eee-995b-e637c013ba72-S3 agent us-west-2 us-west-2b 10.0.5.32 10.0.5.32 446f21c5-2124-4eee-995b-e637c013ba72-S1 agent us-west-2 us-west-2b master.mesos. 10.0.4.195 446f21c5-2124-4eee-995b-e637c013ba72 master (leader) us-west-2 us-west-2b master.mesos. 10.0.4.23 N/A master N/A N/A master.mesos. 10.0.4.51 N/A master N/A N/A in multi master environment only the leader master will have REGION and ZONE displayed. In order to display other master nodes attributes the CLI needs to know external IP address and this is currently not supported.
81733e2
to
a9e2b23
Compare
run all integration tests |
run all integration tests |
add REGION and ZONE fields example: $ dcos task NAME HOST USER STATE ID MESOS ID REGION ZONE abc 10.0.2.140 root R abc.879dde24-a3ce-11e7-9d44-422fc62916d6 446f21c5-2124-4eee-995b-e637c013ba72-S3 us-west-2 us-west-2b if fault domain script was not configured, triple dash will be displayed example: NAME HOST USER STATE ID MESOS ID REGION ZONE abc 10.0.2.140 root R abc.21b24103-a3ce-11e7-9d44-422fc62916d6 446f21c5-2124-4eee-995b-e637c013ba72-S2 --- ---
f6d67c0
to
d848734
Compare
run all integration tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Do we want to add a unit test with the CLI that actually checks the zone / region though? Could be a follow-on PR (or just a JIRA for now).
Would be good to actually exercise the code path here: https://github.com/dcos/dcos-cli/pull/1068/files#diff-0a44a6b7c22f30dd6669ec6caaafa771R740
* add fn get_fault_domain get_fault_domain takes a state json top level or an agent dict and returns a fault domain attributes: region and zone. * update `dcos node` sub command output add fields: REGION, ZONE example: $ dcos node HOSTNAME IP ID TYPE REGION ZONE 10.0.2.140 10.0.2.140 446f21c5-2124-4eee-995b-e637c013ba72-S3 agent us-west-2 us-west-2b 10.0.5.32 10.0.5.32 446f21c5-2124-4eee-995b-e637c013ba72-S1 agent us-west-2 us-west-2b master.mesos. 10.0.4.195 446f21c5-2124-4eee-995b-e637c013ba72 master (leader) us-west-2 us-west-2b master.mesos. 10.0.4.23 N/A master N/A N/A master.mesos. 10.0.4.51 N/A master N/A N/A in multi master environment only the leader master will have REGION and ZONE displayed. In order to display other master nodes attributes the CLI needs to know external IP address and this is currently not supported. * update integration tests * update node/task.txt files for unit tests * update `dcos task` sub command output add REGION and ZONE fields example: $ dcos task NAME HOST USER STATE ID MESOS ID REGION ZONE abc 10.0.2.140 root R abc.879dde24-a3ce-11e7-9d44-422fc62916d6 446f21c5-2124-4eee-995b-e637c013ba72-S3 us-west-2 us-west-2b if fault domain script was not configured, triple dash will be displayed example: NAME HOST USER STATE ID MESOS ID REGION ZONE abc 10.0.2.140 root R abc.21b24103-a3ce-11e7-9d44-422fc62916d6 446f21c5-2124-4eee-995b-e637c013ba72-S2 --- ---
Add 2 new fields:
REGION
andZONE
todcos node
anddcos task
outputDCOS-17719