-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Refactor trust view command into a --pretty flag on trust inspect #934
Conversation
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple small nits
cli/command/trust/inspect.go
Outdated
@@ -11,24 +12,56 @@ import ( | |||
"github.com/theupdateframework/notary/tuf/data" | |||
) | |||
|
|||
type inspectOptions struct { | |||
remotes []string | |||
/* FIXME(n4ss): this is consistent with `docker service inspect` but we should provide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go comments are generally done with //
even if they are multi-line. /* */
is only used for package comments.
@@ -17,24 +17,21 @@ import ( | |||
"github.com/theupdateframework/notary/tuf/data" | |||
) | |||
|
|||
/* TODO(n4ss): remove common tests with the regular inspect command */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same nit about comment
some build failures as well |
8f98b14
to
6cfc125
Compare
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
6cfc125
to
8c3d0b9
Compare
Codecov Report
@@ Coverage Diff @@
## master #934 +/- ##
==========================================
+ Coverage 53.91% 53.92% +<.01%
==========================================
Files 262 262
Lines 16601 16605 +4
==========================================
+ Hits 8951 8954 +3
Misses 7050 7050
- Partials 600 601 +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @n4ss!
Signed-off-by: Nassim 'Nass' Eddequiouaq eddequiouaq.nassim@gmail.com
- What I did
docker trust view
which contains the same information asdocker trust inspect
but in a pretty-print format.--pretty
flag ondocker trust inspect
(same asdocker service inspect [--pretty]
).docker trust view
to testdocker trust inspect --pretty
instead with the new output format (some duplicates tests are now present because the two original commands had some similar tests)docker trust inspect --pretty
(olddocker trust view
) now accepts several images as parameters to inspect (used to be limited to 1, butdocker trust inspect
accepts several images so we had to keep consistency)- How I did it
For now (I'll refactor that later),
docker trust inspect
executes the old codepath if no--pretty
flag is provided on the cli, otherwise executesdocker trust view
's codepath for each image arguments.- How to verify it
$ make -f docker.Makefile test
and
$ docker-dev trust inspect [--pretty] nginx:latest redis:latest docker:dind
- Description for the changelog
docker trust view
to a--pretty
flag ondocker trust inspect
. Thedocker trust view
has been removed.