Commit Graph

1791 Commits

Author SHA1 Message Date
Harald Albers 09701feb71 Disable file completion for `--stop-timeout`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 396d9e02cf Disable file completion for `--shm-size`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers ff9c6846b1 Disable file completion for `--security-opt`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers a40ed99d5a Disable file completion for `--runtime`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 39028ced90 Disable file completion for `--publish`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 968d758988 Disable file completion for `--pids-limit`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 5c963884f5 Add completion for `--pid`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 9817e322d9 Disable file completion for `--oom-score-adj`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 39cd60b6eb Disable file completion for `--network-alias`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers b3703fa109 Disable file completion for `--name`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 31f1f43b1b Disable file completion for `--mount`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 0135d7ed2b Disable file completion for `--memory*`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers e27ff3b202 Disable file completion for `--mac-address`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 6a801bcd40 Disable file completion for `--log-*`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 93af729f53 Disable file completion for `--link-local-ip`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 0e4b312b90 Add completion for `--link`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 846439cdc4 Disable file completion for `--label`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 33d870adb7 Disable file completion for `--kernel-memory`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 77fd7d7a16 Disable file completion for `--isolation`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers b9c7f6c67e Add completion for `--ipc`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 784ad51c67 Disable file completion for `--ip6*`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers e08a00701b Disable file completion for `--hostname`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 3ab5af735a Disable file completion for `--health-*`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers d963cfc964 Disable file completion for `--group-add`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers a5aa7c9037 Disable file completion for `--gpus`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 6aba94e6dd Disable file completion for `--expose`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 9906847f54 Disable file completion for `--entrypoint`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 85ab1210ab Disable file completion for `--domainname`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 14038a915d Disable file completion for `--dns*`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 285d0e32be Disable file completion for `--device-*`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 4450f48f07 Disable file completion for `--cpu*`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 00e3b7cdcc Add completion for `--cgroupns`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers fe1db01af1 Disable file completion for `--cgroup-parent`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 75d80775ce Disable file completion for `--blkio-weight*`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 55d4192c3a Add completion for `--attach`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers 98d5b0389d Disable file completion for `--annotation`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers d9766a3c65 Disable file completion for `--add-host`
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Harald Albers cc981e30ba Share the container completions
Signed-off-by: Harald Albers <github@albersweb.de>
2024-10-28 22:48:37 +00:00
Sebastiaan van Stijn 1aab64dd90
Merge pull request #5547 from thaJeztah/plugin_better_error
cli/command/plugins: use errors.Join instead of custom cli.Errors, and deprecate cli.Errors
2024-10-22 10:42:26 +02:00
Sebastiaan van Stijn 0ab0eca8bd
Merge pull request #5550 from thaJeztah/login_minor_refactor
cli/command: PromptUserForCredentials: assorted minor improvements and (linting) fixes
2024-10-21 23:23:06 +02:00
Laura Brehm 7029147458
Merge pull request #5557 from thaJeztah/minor_linting_issues 2024-10-21 17:00:40 +01:00
Sebastiaan van Stijn 6b9083776f
cli/command: AddPlatformFlag: suppress unhandled error
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-20 17:51:36 +02:00
Sebastiaan van Stijn fb61156b05
cli/command/registry: fix minor linting issues
- fix camelCase naming of verifyLoginOptions
- suppress unhandled errors that can be ignored

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-20 17:51:12 +02:00
Sebastiaan van Stijn 4b7a1e4613
cli/command: PromptUserForCredentials: suppress unhandled errors
Keep the linters (and my IDE) happy; these errors should be safe to ignore.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-19 13:24:19 +02:00
Sebastiaan van Stijn 378a3d7d36
cli/command: PromptUserForCredentials: use consts for all hints
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>
2024-10-19 13:23:29 +02:00
Sebastiaan van Stijn 54e3685bcd
cli/command: ConfigureAuth: fix deprecation comment
Deprecation comments must have an empty line before them, otherwise tools
and linters may not recognise them. While fixing this, also updated the
reference to PromptUserForCredentials to be a docs-link to make it clickable.

Updates 6e4818e7d6.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-19 13:05:31 +02:00
Sebastiaan van Stijn 3d8b49523d
cli/command: PromptUserForCredentials: print error on terminal restore fail
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>
2024-10-19 12:49:44 +02:00
Sebastiaan van Stijn a21a5f4243
cli/command: PromptUserForCredentials: always trim password
we don't support empty passwords; when prompting the user for a password,
we already trim the result, but we didn't do the same for a password that's
passed through stdin or through the `-p` / `--password` flag.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-19 12:10:46 +02:00
Sebastiaan van Stijn eda78e9cdc
cli/command: PromptUserForCredentials: move trimming where it's used
- move trimming defaultUsername inside the if-branch, as it's the only
  location where the result of the trimmed username is use.
- do the reverse for trimming argUser, because the result of trimming
  argUser is used outside of the if-branch (not just for the condition).
  putting it inside the condition makes it easy to assume the result is
  only used locally.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-19 12:07:51 +02:00
Sebastiaan van Stijn 581cf36bd4
cli/command: PromptUserForCredentials: move "post" check for empty name
move the "post" check for username being empty inside the branch
that's handling the username, as it's the only branch where username
is mutated after checking if it's empty.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-19 12:06:49 +02:00