Instead of clearing the whole screen and then writing the new stats,
we now write the new stats on top of the old text, and then clear
the remaining text.
This is a more efficient way to update the stats, as it avoids the
flickering that happens when the screen is cleared and rewritten.
Signed-off-by: Giedrius Jonikas <giedriusj1@gmail.com>
(cherry picked from commit cb2f95ceee)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
make shell
make -C ./internal/gocompat/
GO111MODULE=on go test -v
# github.com/docker/cli/cli/command/container
../../cli/command/container/completion.go:37:28: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../../cli/command/container/completion.go:82:25: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../../cli/command/container/completion.go:92:27: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
FAIL gocompat [build failed]
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d1d5353269)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
commit 4a7b04d412 configured golangci-lint
to use go1.23 semantics, which enabled the copyloopvar linter.
go1.22 now creates a copy of variables when assigned in a loop; make sure we
don't have files that may downgrade semantics to go1.21 in case that also means
disabling that feature; https://go.dev/ref/spec#Go_1.22
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7c80e4f938)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Credits to thaJeztah
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 06260e68f3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Some small adjustments for this branch due to some times being renamed
in master;
63.76 cli/command/system/cmd.go:1: : # github.com/docker/cli/cli/command/system [github.com/docker/cli/cli/command/system.test]
63.76 cli/command/system/client_test.go:22:79: undefined: container.Summary
63.76 cli/command/system/client_test.go:38:103: undefined: container.Summary
63.76 cli/command/system/client_test.go:42:21: undefined: container.Summary
63.76 cli/command/system/completion_test.go:30:86: undefined: container.Summary
63.76 cli/command/system/completion_test.go:31:25: undefined: container.Summary
63.76 cli/command/system/completion_test.go:42:86: undefined: container.Summary (typecheck)
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e1c5180dba)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Update the buildx cli plugin used in the dev-container
full diff: https://github.com/docker/buildx/compare/0.17.1..0.18.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4242cda826)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Also updating a linter that was deprecated;
The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9af049c618)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
There's only 3 locations where it's hit, so putting #gosec ignore comments
in those locations.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 020f3a7ad9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
(cherry picked from commit 172f340112)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The command to run inside the container is `/etc`. The semicolon is a
statement terminator, which ends the command `docker run busybox /etc`,
while `echo $?` prints the exit code of that full docker command.
Having this mistake could confuse someone who thinks that `/etc; echo
$?` is all run inside the container, which wouldn't help the reader
understand the exit code of the `docker run` command itself.
Signed-off-by: Noah Silas <noah@hustle.com>
(cherry picked from commit 0c999fe95b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Keep the linters (and my IDE) happy; these errors should be safe to ignore.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4b7a1e4613)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This message resulted in code-lines that were too long; move it to a
const together with the other hint. While at it, also suppress unhandled
error, and touch-up the code-comment.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 378a3d7d36)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
If restoring the terminal state fails, "echo" no longer works, which means
that anything the user types is no longer shown. The login itself may already
have succeeded, so we should not fail the command, but it's good to inform
the user that this happened, which may give them a clue why things no longer
work as they expect them to work.
With this patch:
docker login -u yourname
Password:
Error: failed to restore terminal state to echo input: something bad happened
Login Succeeded
We should consider printing instructions how to restore this manually (other
than restarting the shell). e.g., 'run stty echo' when in a Linux or macOS shell,
but PowerShell and CMD.exe may need different instructions.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3d8b49523d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>