-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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 --no-trunc to service/node/stack ps output #25337
Conversation
Seems ok to me, although the meaning of |
@vdemeester Although that's the only thing |
I think |
@@ -41,7 +41,7 @@ func (t tasksBySlot) Less(i, j int) bool { | |||
} | |||
|
|||
// Print task information in a table format | |||
func Print(dockerCli *client.DockerCli, ctx context.Context, tasks []swarm.Task, resolver *idresolver.IDResolver) error { | |||
func Print(dockerCli *client.DockerCli, ctx context.Context, tasks []swarm.Task, resolver *idresolver.IDResolver, noTrunc bool) error { |
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.
should we inverse this, and make this trunc
? Maybe just preference, but not really fond of the double negative :D
happy to hear what others think
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.
So i had the same thought but docker ps
passes it around as noTrunc
so i kept it.
design +1 |
don't forget the completion scripts; probably something like this; diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker
index f3a7407..139bfbe 100644
--- a/contrib/completion/bash/docker
+++ b/contrib/completion/bash/docker
@@ -1690,7 +1690,7 @@ _docker_service_ps() {
case "$cur" in
-*)
- COMPREPLY=( $( compgen -W "--all -a --filter -f --help --no-resolve" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "--all -a --filter -f --help --no-resolve --no-trunc" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '--filter|-f')
@@ -2049,7 +2049,7 @@ _docker_node_ps() {
case "$cur" in
-*)
- COMPREPLY=( $( compgen -W "--all -a --filter -f --help --no-resolve" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "--all -a --filter -f --help --no-resolve --no-trunc" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '--filter|-f')
diff --git a/contrib/completion/zsh/_docker b/contrib/completion/zsh/_docker
index 1eed282..6ccfdd5 100644
--- a/contrib/completion/zsh/_docker
+++ b/contrib/completion/zsh/_docker
@@ -840,6 +840,7 @@ __docker_node_subcommand() {
"($help -a --all)"{-a,--all}"[Display all instances]" \
"($help)*"{-f=,--filter=}"[Provide filter values]:filter:->filter-options" \
"($help)--no-resolve[Do not map IDs to Names]" \
+ "($help)--no-trunc[Do not truncate output]" \
"($help -)1:node:__docker_complete_nodes" && ret=0
case $state in
(filter-options)
@@ -1155,6 +1156,7 @@ __docker_service_subcommand() {
"($help -a --all)"{-a,--all}"[Display all tasks]" \
"($help)*"{-f=,--filter=}"[Provide filter values]:filter:->filter-options" \
"($help)--no-resolve[Do not map IDs to Names]" \
+ "($help)--no-trunc[Do not truncate output]" \
"($help -)1:service:__docker_complete_services" && ret=0
case $state in
(filter-options) |
@thaJeztah no love for fish shell 😢 |
@jhorwit2 I think it's in need of some love yes; IIRC it has a script to update automatically, but it's been a while since I looked at it |
@jhorwit2 can you make the changes for Thanks! |
@crosbymichael 👍 done |
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
LGTM |
LGTM |
Is it released? I've got |
@Vanuan it's on the 1.13 milestone, so will be part of that release. If you want to live on the edge, you can download static binaries from https://master.dockerproject.org |
How about |
closes #25332
- What I did
Added
--no-trunc
option likedocker ps
has todocker service ps
,docker node ps
anddocker stack ps
. Currently only errors were being truncated.- How I did it
Added cli option to the 3 commands & check for it in
task.Print
- How to verify it
Create a service that has tasks that error out -> run
docker node ps self --no-trunc
to see the full error.- Description for the changelog
Add --no-trunc to service/node/stack ps output
Signed-off-by: Josh Horwitz horwitzja@gmail.com