Skip to content
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
Copy link
Member

@yongtang 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

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
Copy link
Member

SGTM but why not "Created"?

@yongtang
Copy link
Member Author

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.

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

design LGTM 🐯
/cc @thaJeztah @dnephin

@thaJeztah
Copy link
Member

Yup, design LGTM

@dnephin
Copy link
Member

dnephin commented Jan 5, 2017

LGTM

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

LGTM, moving to doc review

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐸
/cc @thaJeztah

@AkihiroSuda
Copy link
Member

@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
Copy link

Choose a reason for hiding this comment

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

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

Copy link

Choose a reason for hiding this comment

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

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

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah thaJeztah merged commit 8820266 into moby:master Jan 24, 2017
@GordonTheTurtle GordonTheTurtle added this to the 1.14.0 milestone Jan 24, 2017
@yongtang yongtang deleted the 29226-network-format-created-at branch January 24, 2017 16:50
dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
…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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants