make secret ls support filters in CLI#30810
Conversation
bec81ff to
604dcca
Compare
|
While here I still have some confusion that the |
604dcca to
848e977
Compare
|
Good catch. Looks like it should be |
|
LGTM |
|
ping @aaronlehmann |
Filters for other types of objects don't seem to support |
e281e7b to
ce4d948
Compare
|
Thanks a lot for all your feedback. |
|
LGTM |
ce4d948 to
f2a6c7a
Compare
|
Since it was |
f2a6c7a to
d398b26
Compare
|
I added |
d398b26 to
51aed85
Compare
There was a problem hiding this comment.
As it is supported in 1.13 release (the names filter), we can't remove it just like that. We need to do what our deprecation policy requires us to do (i.e. mark it as deprecated for next release, and will be remove in 3 more releases)
/cc @thaJeztah
There was a problem hiding this comment.
:( figured this was added after 1.13
There was a problem hiding this comment.
Yeah API 1.25 and above support this 😓
There was a problem hiding this comment.
This should be a unit test I think 👼
There was a problem hiding this comment.
This test could be merged with the other one (that would let use create and start one daemon, create once the secret and then list them with or without filters).
There was a problem hiding this comment.
removed already 😄 same as the below one.
6d96855 to
9c23fd3
Compare
vdemeester
left a comment
There was a problem hiding this comment.
Thanks for the unit tests 👼 I feel some cases are redundant (for each, think of what your are testing and anything that you test multiple time can reduced to once) but that's a nit. The integration test could be a little bit more readable (by extracting some common stuff, like the creation of secrets, the common part of each filter command), but that's a nit too.
But we need to version this change and make sure filtering using names work on API 1.25 and 1.26 🙏
There was a problem hiding this comment.
We have to accept this still (for few version and for API versions 1.25 and 1.26). We need to "version" the accepted list of filter.
There was a problem hiding this comment.
yeah, we have to say to removal seems not so reasonable, added it back already.
There was a problem hiding this comment.
This test is testing the same as above right ? (an invalid value in the middle of valid ones) — if yes, could be remove 👼
|
going to docs-review 👼 /cc @thaJeztah |
9a1fe51 to
6cf6994
Compare
thaJeztah
left a comment
There was a problem hiding this comment.
Thanks @allencloud, I left some comments
There was a problem hiding this comment.
Can you add a blank line before this? I think the Jekyll markdown parser doesn't like it if there's isn't a blank line 😓
There was a problem hiding this comment.
can you change the first sentence to;
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. .....There was a problem hiding this comment.
I think in other locations we add a short description here, something like;
* [id](secret_ls.md#id) (secret's ID)
* [label](secret_ls.md#label) (`label=<key>` or `label=<key>=<value>`)
* [name](secret_ls.md#name) (secret's name)
Do we need names (plural) here? I know we have "names" for docker ps because of historical reasons (linked containers), but I don't think it's needed for secrets?
There was a problem hiding this comment.
For a follow up discussion; I'm not very fond of just id here as heading; I think having filter by id or filter secrets by id would be more descriptive, and possibly better for discoverability (searching on Google or the docs search)
@mstanleyjones WDYT?
There was a problem hiding this comment.
Do we have names (plural) as filter currently? Or only name ?
There was a problem hiding this comment.
Sorry for my delay. I am afraid that currently we support names. And this is something we hope to deprecate to use name instead. Actually it is indeed supported in docker/master.
There was a problem hiding this comment.
@allencloud but docker 17.03 does not have docker secret ls --filter. In that case we can remove support for "names", because it has not yet been in a release
There was a problem hiding this comment.
Or is it used somewhere else already?
There was a problem hiding this comment.
Ah, I see, it was already used behind the scenes https://github.com/docker/docker/pull/30810/files#diff-74117112d8788c60f76ddd5fdb6e62b4R30
There was a problem hiding this comment.
Can you move the tests for other objects to a separate PR?
There was a problem hiding this comment.
I'd opt for removing names (plural). The examples in this section are also incorrect, because they use name (singular)
There was a problem hiding this comment.
Any input for names in secret filtering? @ehazlett @vdemeester @aaronlehmann
There was a problem hiding this comment.
Thanks @aaronlehmann, I removed names in the command docker secret ls doc, while remained that in swagger.yml. Is that OK? PTAL
There was a problem hiding this comment.
Hm, I think we do this in other places as well, but wondering; do we actually match a part or only a prefix (which is, erm, a part, but only if the ID starts with the given value)
There was a problem hiding this comment.
I think id filtering is only supported by whole id, or prefix of ID. like:
root@ip-172-31-23-42:~/gocode/src/github.com/allencloud/docker/bundles/17.05.0-dev/binary-client# ./docker secret ls
ID NAME CREATED UPDATED
6697bflskwj1998km1gnnjr38 q5s5570vtvnimefos1fyeo2u2 7 weeks ago 7 weeks ago
9u9hk4br2ej0wgngkga6rp4hq my_secret 6 weeks ago 6 weeks ago
lofl440t1pmh7vz3qt81v704g allen 6 days ago 6 days ago
mem02h8n73mybpgqjf0kfi1n0 test_secret 6 days ago 6 days ago
sj04gk80yqk2xtdrs64nsyoln test 6 weeks ago 6 weeks ago
ueo2vbjbl8kk97mrmlq509e7r my_secsret 5 weeks ago 5 weeks ago
root@ip-172-31-23-42:~/gocode/src/github.com/allencloud/docker/bundles/17.05.0-dev/binary-client# ./docker secret ls --filter id=66
ID NAME CREATED UPDATED
6697bflskwj1998km1gnnjr38 q5s5570vtvnimefos1fyeo2u2 7 weeks ago 7 weeks ago
|
Any updates? |
f5f2dfa to
9bc7bd9
Compare
Signed-off-by: allencloud <allen.sun@daocloud.io>
9bc7bd9 to
3935074
Compare
|
Updated. PTAL @thaJeztah |
|
/cc @albers @sdurrheimer for completion scripts 👍 |
|
failures are not related |
|
@thaJeztah bash completion is blocked by pending #32013. |
…filter make secret ls support filters in CLI
Signed-off-by: allencloud allen.sun@daocloud.io
This pr makes command
docker secret lssupport filter.I found that in daemon API, we have already supported secret list filter query. While I found that in docker CLI, there is no support of this filter yet.
- What I did
docker secret ls --filter;docker secret ls.- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)