16 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
3382ee3e99
cli/command/context: use stdlib errors, remove errdefs uses
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 20:18:41 +02:00
Sebastiaan van Stijn
6fd72c6333
context: add shell-completion for context-names
For now, these are not exported and included in the cli/commands/contexts
package; a copy of this also lives in cmd/docker, but we need to find a
good place for these completions, as some of them bring in additional
dependencies.

Commands that accept multiple arguments provide completion, but removing
duplicates:

    docker context inspect<TAB>
    default  desktop-linux  (current)  production  tcd

    docker context inspec default<TAB>
    desktop-linux  (current)  production  tcd

    docker context inspect default tcd<TAB>
    desktop-linux  (current)  production

For "context export", we provide completion for the first argument, after
which file-completion is provided:

    # provides context names completion for the first argument
    docker context export production<TAB>
    default  desktop-linux  (current)  production  tcd

    # then provides completion for filenames
    docker context export desktop-linux<TAB>
    build/           man/                TESTING.md
    cli/             docker.Makefile     go.mod
    ...

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-17 10:32:18 +02:00
Sebastiaan van Stijn
82e2efbbf7
cli/command/context: minor cleanups
- use dockerCLI with Go's standard camelCase casing.
- suppress some errors to make my IDE and linters happier

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-03 12:18:10 +01:00
Sebastiaan van Stijn
8e9aec6904
golangci-lint: revive: enable import-shadowing
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-11-20 19:52:41 +01:00
Sebastiaan van Stijn
2133d0446a
cli/command/context: remove deprecated k8s / orchestrator option-stubs
support for kubernetes contexts was deprecated in docker 20.10 through
b639ea8b89b162c3abe99d3ac90b258c48e2039c, 0793f9639440d8980226485189ce0eb43e0af28b,
and 1d37fb302789c6ce4ba120bc4ad577c92674467f, and removed altoghether in
23.0 through 193ede9b12b53e8aa595356e8b823f883e49bdc5.

This patch removes the remaining stubs for options that were deprecated
and no longer used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-21 11:39:04 +02:00
Sebastiaan van Stijn
8181aa8879
cli/command/context: don't pass CLI if we only need context-store
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-20 13:39:02 +02:00
Nicolas De Loof
fd2bc1fa5e
use our own version of text/tabwriter
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-04-25 15:01:41 +02:00
Sebastiaan van Stijn
242857dd81
update/remove various tests and options related to kubernetes support
Remove various tests and utilities related to testing kubernetes support

Also removing the Kubernetes and DefaultStackOrchestrator from CreateOptions
and UpdateOptions, instead updating the flags to not be bound to a variable.

This might break some consumers of those options, but given that they've become
non-functional, that's probably ok (otherwise they may ignore the deprecation
warning and end up with non-functional code).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-02-24 17:53:18 +01:00
Nicolas De Loof
193ede9b12
remove obsolete mutli-orchestrator support
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-02-22 15:28:12 +01:00
Nicolas De Loof
1d48749c1c warn user kubernetes is deprecated and options won't be stored in context
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-02-22 13:47:34 +01:00
Nicolas De Loof
7b9580df51 Drop support for (archived) Compose-on-Kubernetes
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-02-22 13:47:34 +01:00
Mathieu Champlon
a033cdf515 Deprecate Kubernetes context support
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2021-07-01 18:39:00 +02:00
Chris Crone
8c2872d2a3
context: Ensure context name is valid on import
Signed-off-by: Chris Crone <christopher.crone@docker.com>
(cherry picked from commit 9ecc69d17e40cd0a03b6b03d8421bc415936d231)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-02 13:51:15 +01:00
Simon Ferquel
a3efd5d195 Cleanup context store interfaces
This remove the term "context" from context store interfaces, to make
them more concise

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-04-18 15:49:36 +02:00
Simon Ferquel
3126920af1 Add context store config options and expose context commands
This will allow plugins to have custom typed endpoints, as well as
create/remove/update contexts with the exact same results as the main
CLI (thinking of things like `docker ee login https://my-ucp-server
--context ucp-prod)`

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-29 11:19:54 +01:00
Simon Ferquel
591385a1d0 Fast Context Switch: commands
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-10 22:25:43 +01:00