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

Add `.CreatedAt` placeholder for `docker network ls --format` #29900

Merged
merged 1 commit into from Jan 24, 2017

Conversation

@yongtang
Member

yongtang commented Jan 4, 2017

- What I did

This fix tries to add a placeholder .CreatedAt for Go format template in docker network ls --format.

While working on #29226, I noticed that it is not possible to display network's creation time in docker network ls, with or without --format.

We are able to find the timestamp of the network through docker network inspect though.

However, as we allow networks to be pruned based on the timestamp (see #29226), showing the timestamp in docker network ls --format would be much useful now.

- How I did it

This fix adds the .CreatedAt placeholder for docker network ls --format.

The default output was not changed for docker network ls --format.

- How to verify it

A test case for unit tests has been added.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Yong Tang yong.tang.github@outlook.com

Add `.CreatedAt` placeholder for `docker network ls --format`
This fix tries to add a placeholder `.CreatedAt` for Go
format template in `docker network ls --format`.

While working on 29226, I noticed that it is not possible to
display network's creation time in `docker network ls`, with or
without `--format`.

We are able to find the timestamp through `docker network inspect` though.

However, as we allows networks to be pruned based on the timestamp
(see 29226), showing the timestamp in `docker network ls --format`
would be much useful now.

This fix adds the `.CreatedAt` placeholder for `docker network ls --format`.
The default output was not changed for `docker network ls --format`.

A test case for unit tests has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@AkihiroSuda

This comment has been minimized.

Show comment
Hide comment
@AkihiroSuda

AkihiroSuda Jan 5, 2017

Member

SGTM but why not "Created"?

Member

AkihiroSuda commented Jan 5, 2017

SGTM but why not "Created"?

@yongtang

This comment has been minimized.

Show comment
Hide comment
@yongtang

yongtang Jan 5, 2017

Member

@AkihiroSuda this is mostly to align with docker images --format and docker ps --format. Both images and containers use CreatedAt.

Member

yongtang commented Jan 5, 2017

@AkihiroSuda this is mostly to align with docker images --format and docker ps --format. Both images and containers use CreatedAt.

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Jan 5, 2017

Member

Yup, design LGTM

Member

thaJeztah commented Jan 5, 2017

Yup, design LGTM

@dnephin

This comment has been minimized.

Show comment
Hide comment
@dnephin

dnephin Jan 5, 2017

Member

LGTM

Member

dnephin commented Jan 5, 2017

LGTM

@AkihiroSuda

LGTM, moving to doc review

@vdemeester

LGTM 🐸
/cc @thaJeztah

@AkihiroSuda

This comment has been minimized.

Show comment
Hide comment
@AkihiroSuda
Member

AkihiroSuda commented Jan 24, 2017

@thaJeztah PTAL?

`.Internal` | Whether the network is internal or not.
`.Labels` | All labels assigned to the network.
`.Label` | Value of a specific label for this network. For example `{{.Label "project.version"}}`
`.CreatedAt` | Time when the network was created

This comment has been minimized.

@chanwit

chanwit Jan 24, 2017

The doc SGTM but I'm wondering why changes are 10 lines instead of 1 insertion?

@chanwit

chanwit Jan 24, 2017

The doc SGTM but I'm wondering why changes are 10 lines instead of 1 insertion?

This comment has been minimized.

@chanwit

chanwit Jan 24, 2017

Oh my bad. It's from formatting the table.

@chanwit

chanwit Jan 24, 2017

Oh my bad. It's from formatting the table.

@thaJeztah

LGTM, thanks!

@thaJeztah thaJeztah merged commit 8820266 into moby:master Jan 24, 2017

4 checks passed

dco-signed All commits are signed
experimental Jenkins build Docker-PRs-experimental 29207 has succeeded
Details
janky Jenkins build Docker-PRs 37799 has succeeded
Details
windowsRS1 Jenkins build Docker-PRs-WoW-RS1 8863 has succeeded
Details

@GordonTheTurtle GordonTheTurtle added this to the 1.14.0 milestone Jan 24, 2017

@yongtang yongtang deleted the yongtang:29226-network-format-created-at branch Jan 24, 2017

dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017

Merge pull request moby#29900 from yongtang/29226-network-format-crea…
…ted-at

Add `.CreatedAt` placeholder for `docker network ls --format`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment