Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Allow user to define fields returned in fleetctl list-units and list-machines #337

Merged
merged 1 commit into from
May 22, 2014

Conversation

jonboulle
Copy link
Contributor

e.g.

fleetctl list-units -o name,machine
fleetctl list-units -o name,state,sub

@bcwaldon bcwaldon changed the title feat(fleetctl): support user-defined output formats in "list-units" Allow user to define fields returned in fleetctl list-units and list-machines May 12, 2014
@jonboulle
Copy link
Contributor Author

14.8% -> 18.8% coverage. yay.

I'm not sold on the name of the option, so very open to suggestions.

@jonboulle jonboulle self-assigned this May 20, 2014
@jonboulle
Copy link
Contributor Author

Also this doesn't implement list-machines - will follow that up separately.

@bcwaldon
Copy link
Contributor

Failing tests:

gopath/src/github.com/coreos/fleet/fleetctl/list_units_test.go:98: too few values in struct initializer

}
return d
},
"machine": func(j *job.Job, full bool) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Once this lands, it would be a good idea to provide "public-ip" and "machine-id" fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nod. #179 shows how easy this makes it to add new fields ;-)

@jonboulle
Copy link
Contributor Author

Fixed silly test breakage.

@jonboulle
Copy link
Contributor Author

Renamed to fields.

@bcwaldon
Copy link
Contributor

lgtm

@jonboulle
Copy link
Contributor Author

Cool beans.

jonboulle added a commit that referenced this pull request May 22, 2014
Allow user to define fields returned in fleetctl list-units
@jonboulle jonboulle merged commit c315c21 into coreos:master May 22, 2014
@jonboulle jonboulle deleted the 337 branch May 22, 2014 18:58
@bcwaldon bcwaldon added this to the v0.4.0 milestone May 26, 2014
@bacongobbler
Copy link
Contributor

👍

This helps us parse the job's state, such as what we attempt to accomplish here. Being able to define the fields returned from list-units makes it easier to migrate between fleetctl versions for us in this specific use case.

Nice work guys :)

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

Successfully merging this pull request may close these issues.

3 participants