-
Notifications
You must be signed in to change notification settings - Fork 302
Expose target machine/state fields in list-units #664
Conversation
👍 |
@jonboulle I'm going to switch |
ack |
Can you update documentation too? |
bar |
@jonboulle updated states.md along with the first two commits, but using-the-client.md was way out of date so I updated that along with some unrelated stuff in a third commit. |
@@ -39,3 +40,4 @@ The systemd state is composed of three subcomponents, also exposed in `fleetctl | |||
- `ACTIVE` (the high-level unit activation state, i.e. generalization of SUB) | |||
- `SUB` (the low-level unit activation state, values depend on unit type) | |||
|
|||
By default, on the `ACTIVE` state is exposed from `fleetctl list-units`. Expose the `LOAD` and `SUB` fields using the `--fields` flag to `fleetctl list-units`. |
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.
S/on the/only the/
S/from/in/
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.
thanks for reading through that :)
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.
@jonboulle fixed
Any idea if the deis guys/anyone else are still parsing fleetctl output without --fields? Maybe worth reaching out |
@gabrtv @carmstrong Is this going to bite you guys? |
Agreed - had to look at the output a few times to glean its value.
Looks like it will. We Any idea when this beat will drop, @bcwaldon? |
@carmstrong As soon as you say we can :) This information is incredibly useful when debugging failures, so I want to get it out in people hands ASAP. Short term, you could just append this to all of your
|
Good enough for us. We're actually still using CoreOS 349.0.0 - we want to grab the latest alpha as soon as Docker is bumped to 1.1+, so if this change will be in that release, I'll make these changes now. |
@carmstrong This change is unlikely to make it into the next alpha release, but it should make its way out within the next few. |
Sounds reasonable. We'll grab the next alpha and will probably be on that for a little while. |
@jonboulle ok, sounds reasonably safe once I get your LGTM |
LGTM. |
|
||
Jobs may only transition directly between these states. For example, for a job to transition from `inactive` to `launched` it must first go state `loaded`. | ||
|
||
The current job state is exposed in the `state` column of the output from `fleetctl list-units`. | ||
The desired state and the last known states are exposed in the `DSTATE` and `STATE` columns of the output from `fleetctl list-units`. |
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.
last known state
, or desired and last known states
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
Drop the loaded, sub and description fields. Add the dstate and tmachine fields.
@@ -11,7 +11,7 @@ import ( | |||
) | |||
|
|||
const ( | |||
defaultListUnitsFields = "unit,state,load,active,sub,desc,machine" | |||
defaultListUnitsFields = "unit,dstate,tmachine,state,machine,active" |
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.
I missed something - what's the real value in providing tmachine
in the default output?
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.
If TMACHINE != MACHINE, something has gone wrong.
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.
I understand that, just not sure it adds enough utility to be in the default output.
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.
Fair point. Until we fix #638, I believe it is incredibly important to expose in the default output. Once we feel more confident in how we're publishing state, I'm fine with removing it from the default output..
On a related note, how would you feel about implementing + and - to the --fields option? For example, running fleetctl list-units --fields -tmachine,+hash
would hide the tmachine field but add the hash field. Useful?
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.
Sounds a bit overly complex and trouble-prone to me - at that stage why not just explicitly name all the fields? and it ties us to the default output fields more closely.
I'd entertain a PR but wouldn't do it myself.
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.
Yeah, I agree. It would basically be a shorthand for humans, but give people the ability to shoot themselves in the foot if they write a script against it.
lgtm |
Expose target machine/state fields in list-units
Add new
TSTATE
andTMACHINE
fields to list-units, dropping some irrelevant states from the default list.In the event that you have two units that conflict with one another, this was the old output you would see:
...and the new output:
This new format at least gives you an idea of what bar.service should be doing