Skip to content

Suppressing digest for docker service ls/ps#28539

Merged
vdemeester merged 1 commit intomoby:masterfrom
nishanttotla:pin-image-digest-ux
Nov 21, 2016
Merged

Suppressing digest for docker service ls/ps#28539
vdemeester merged 1 commit intomoby:masterfrom
nishanttotla:pin-image-digest-ux

Conversation

@nishanttotla
Copy link
Contributor

@nishanttotla nishanttotla commented Nov 17, 2016

This PR simplifies the UI for the changes introduced in #28173 (Pin images by digest).

In particular, this PR suppresses the digest for docker service ls and docker service ps, showing only image:tag. The full digest image:tag@digest is still shown as part of docker service inspect.

Fix #28502

@nishanttotla
Copy link
Contributor Author

Looks like test failures are related, working on fixing them now.

Choose a reason for hiding this comment

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

This type assertion may fail. Images do not always have a tag.

This is probably why some tests are failing.

You shouldn't ignore the second value from the type assertion:

namedTagged, ok := ref.(distreference.NamedTagged)

and the use of Name and Tag should be guarded by if ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aaronlehmann At first I thought that the tests were checking against the spec which was causing failures (still confirming that). I've updated to include the ok value from the type assertion.

@nishanttotla
Copy link
Contributor Author

Tests pass now. Ping @aaronlehmann @cpuguy83 @thaJeztah

@cpuguy83
Copy link
Member

Is there anything we can do for docker ps as well?

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

Sorry for the late reply; looking at docker service ps we do have --no-trunc. Shouldn't we show the full image reference if I use that? Right now there's no difference (probably only ERROR isn't truncated)

docker service ps web
NAME                IMAGE         NODE          DESIRED STATE  CURRENT STATE               ERROR  PORTS
web.1.qk6sjgd0b0kq  nginx:alpine  d610c3c51568  Running        Running about a minute ago

docker service ps --no-trunc web
NAME                IMAGE         NODE          DESIRED STATE  CURRENT STATE               ERROR  PORTS
web.1.qk6sjgd0b0kq  nginx:alpine  d610c3c51568  Running        Running about a minute ago

@nishanttotla
Copy link
Contributor Author

@thaJeztah that makes sense. Is --no-trunc only meant for docker service ps, or also makes sense for docker service ls?

Choose a reason for hiding this comment

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

remove this comment

Choose a reason for hiding this comment

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

remove this comment

@nishanttotla nishanttotla force-pushed the pin-image-digest-ux branch 2 times, most recently from cac53ca to a717a64 Compare November 18, 2016 17:38
@nishanttotla
Copy link
Contributor Author

nishanttotla commented Nov 18, 2016

@thaJeztah updated PR to print full image string if --no-trunc is supplied for docker service ps.

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!

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 👼

@vdemeester
Copy link
Member

There should be docs-update right ?

@vdemeester vdemeester merged commit 278e01d into moby:master Nov 21, 2016
@vdemeester
Copy link
Member

@thaJeztah will do a follow-up for the docs ⚓

@cpuguy83
Copy link
Member

@nishanttotla Did you have a chance to check if docker ps could get a similar fix?

@nishanttotla nishanttotla deleted the pin-image-digest-ux branch November 21, 2016 19:15
@nishanttotla
Copy link
Contributor Author

@cpuguy83 I thought docker ps already did this, but I will double check to confirm.

@nishanttotla
Copy link
Contributor Author

@cpuguy83 you're right, this should be done for docker ps as well. I'll send out a PR.

dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
Suppressing digest for docker service ls/ps
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