Skip to content

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

Merged
thaJeztah merged 1 commit into
moby:masterfrom
yongtang:29226-network-format-created-at
Jan 24, 2017
Merged

thaJeztah merged 1 commit into
moby:masterfrom
yongtang:29226-network-format-created-at

Conversation

@yongtang

@yongtang yongtang commented Jan 4, 2017 •

Copy link
Copy Markdown
Member

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

SGTM but why not "Created"?

@yongtang

yongtang commented Jan 5, 2017

Copy link
Copy Markdown
Member Author

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

@vdemeester vdemeester left a comment

Copy link
Copy Markdown
Member

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

Yup, design LGTM

@dnephin

dnephin commented Jan 5, 2017

Copy link
Copy Markdown
Member

LGTM

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

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

@vdemeester vdemeester left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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.

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

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