From cff010c61fb33907e196ac0b54326cdd40b33b0c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Feb 2022 18:01:24 +0100 Subject: [PATCH 1/9] context export: remove docker context export --kubeconfig options Removes the --kubeconfig flag, and the corresponding ExportOptions.Kubeconfig, as well as special handling for kubeconfig export, as it's no longer used. Signed-off-by: Sebastiaan van Stijn --- cli/command/context/export.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/cli/command/context/export.go b/cli/command/context/export.go index 7e27fa56be45..d06e84d94a68 100644 --- a/cli/command/context/export.go +++ b/cli/command/context/export.go @@ -14,7 +14,6 @@ import ( // ExportOptions are the options used for exporting a context type ExportOptions struct { - Kubeconfig bool ContextName string Dest string } @@ -23,26 +22,22 @@ func newExportCommand(dockerCli command.Cli) *cobra.Command { opts := &ExportOptions{} cmd := &cobra.Command{ Use: "export [OPTIONS] CONTEXT [FILE|-]", - Short: "Export a context to a tar or kubeconfig file", + Short: "Export a context to a tar archive FILE or a tar stream on STDOUT.", Args: cli.RequiresRangeArgs(1, 2), RunE: func(cmd *cobra.Command, args []string) error { opts.ContextName = args[0] if len(args) == 2 { opts.Dest = args[1] } else { - opts.Dest = opts.ContextName - if opts.Kubeconfig { - opts.Dest += ".kubeconfig" - } else { - opts.Dest += ".dockercontext" - } + opts.Dest = opts.ContextName + ".dockercontext" } return RunExport(dockerCli, opts) }, } flags := cmd.Flags() - flags.BoolVar(&opts.Kubeconfig, "kubeconfig", false, "Export as a kubeconfig file") + flags.Bool("kubeconfig", false, "Export as a kubeconfig file") + flags.MarkDeprecated("kubeconfig", "option will be ignored") flags.SetAnnotation("kubeconfig", "kubernetes", nil) flags.SetAnnotation("kubeconfig", "deprecated", nil) return cmd From 1924bc9f0fa7461f56ed01de0aba95f98677bfb9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Feb 2022 18:02:15 +0100 Subject: [PATCH 2/9] stack/swarm: remove unneeded getStackServiceFilter() It was now an alias for getStackFilter, so no longer needed Signed-off-by: Sebastiaan van Stijn --- cli/command/stack/swarm/common.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cli/command/stack/swarm/common.go b/cli/command/stack/swarm/common.go index b4193df3609a..12731c0d8826 100644 --- a/cli/command/stack/swarm/common.go +++ b/cli/command/stack/swarm/common.go @@ -17,10 +17,6 @@ func getStackFilter(namespace string) filters.Args { return filter } -func getStackServiceFilter(namespace string) filters.Args { - return getStackFilter(namespace) -} - func getStackFilterFromOpt(namespace string, opt opts.FilterOpt) filters.Args { filter := opt.Value() filter.Add("label", convert.LabelNamespace+"="+namespace) @@ -34,7 +30,7 @@ func getAllStacksFilter() filters.Args { } func getStackServices(ctx context.Context, apiclient client.APIClient, namespace string) ([]swarm.Service, error) { - return apiclient.ServiceList(ctx, types.ServiceListOptions{Filters: getStackServiceFilter(namespace)}) + return apiclient.ServiceList(ctx, types.ServiceListOptions{Filters: getStackFilter(namespace)}) } func getStackNetworks(ctx context.Context, apiclient client.APIClient, namespace string) ([]types.NetworkResource, error) { From 16ece9bb8212da9d727d07f5770e3c876faa8779 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Feb 2022 18:03:06 +0100 Subject: [PATCH 3/9] system/version: remove dead-code Signed-off-by: Sebastiaan van Stijn --- cli/command/system/version.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cli/command/system/version.go b/cli/command/system/version.go index a47cd378c317..3d1d9b9289f9 100644 --- a/cli/command/system/version.go +++ b/cli/command/system/version.go @@ -128,13 +128,6 @@ func runVersion(dockerCli command.Cli, opts *versionOptions) error { } // TODO print error if kubernetes is used? - // orchestrator, err := dockerCli.StackOrchestrator("") - // if err != nil { - // return cli.StatusError{StatusCode: 64, Status: err.Error()} - // } - // if orchestrator.HasKubernetes() { - // // TODO print error if kubernetes is used? - // } vd := versionInfo{ Client: clientVersion{ From 869370a3fe87169daee698451df90575df29d0fe Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Feb 2022 18:04:13 +0100 Subject: [PATCH 4/9] docs: remove mention of DOCKER_STACK_ORCHESTRATOR env-var Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/cli.md | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/docs/reference/commandline/cli.md b/docs/reference/commandline/cli.md index 29893221567a..1175c7ba834c 100644 --- a/docs/reference/commandline/cli.md +++ b/docs/reference/commandline/cli.md @@ -65,18 +65,17 @@ the [installation](https://docs.docker.com/install/) instructions for your opera The following list of environment variables are supported by the `docker` command line: -| Variable | Description | -|:------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------| -| `DOCKER_API_VERSION` | Override the negotiated API version to use for debugging (e.g. `1.19`) | +| Variable | Description | +|:------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------| +| `DOCKER_API_VERSION` | Override the negotiated API version to use for debugging (e.g. `1.19`) | | `DOCKER_CERT_PATH` | Location of your authentication keys. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) | -| `DOCKER_CONFIG` | The location of your client configuration files. | -| `DOCKER_CONTENT_TRUST_SERVER` | The URL of the Notary server to use. Defaults to the same URL as the registry. | -| `DOCKER_CONTENT_TRUST` | When set Docker uses notary to sign and verify images. Equates to `--disable-content-trust=false` for build, create, pull, push, run. | -| `DOCKER_CONTEXT` | Name of the `docker context` to use (overrides `DOCKER_HOST` env var and default context set with `docker context use`) | -| `DOCKER_DEFAULT_PLATFORM` | Default platform for commands that take the `--platform` flag. | +| `DOCKER_CONFIG` | The location of your client configuration files. | +| `DOCKER_CONTENT_TRUST_SERVER` | The URL of the Notary server to use. Defaults to the same URL as the registry. | +| `DOCKER_CONTENT_TRUST` | When set Docker uses notary to sign and verify images. Equates to `--disable-content-trust=false` for build, create, pull, push, run. | +| `DOCKER_CONTEXT` | Name of the `docker context` to use (overrides `DOCKER_HOST` env var and default context set with `docker context use`) | +| `DOCKER_DEFAULT_PLATFORM` | Default platform for commands that take the `--platform` flag. | | `DOCKER_HIDE_LEGACY_COMMANDS` | When set, Docker hides "legacy" top-level commands (such as `docker rm`, and `docker pull`) in `docker help` output, and only `Management commands` per object-type (e.g., `docker container`) are printed. This may become the default in a future release, at which point this environment-variable is removed. | -| `DOCKER_HOST` | Daemon socket to connect to. | -| `DOCKER_STACK_ORCHESTRATOR` | Configure the default orchestrator to use when using `docker stack` management commands. | +| `DOCKER_HOST` | Daemon socket to connect to. | | `DOCKER_TLS_VERIFY` | When set Docker uses TLS and verifies the remote. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) | | `BUILDKIT_PROGRESS` | Set type of progress output (`auto`, `plain`, `tty`) when [building](build.md) with [BuildKit backend](../builder.md#buildkit). Use plain to show container output (default `auto`). | @@ -192,14 +191,6 @@ for a specific registry. For more information, see the [**Credential helpers** section in the `docker login` documentation](login.md#credential-helpers) -### Orchestrator options for docker stacks - -The property `stackOrchestrator` specifies the default orchestrator to use when -running `docker stack` management commands. Valid values are `"swarm"`, -`"kubernetes"`, and `"all"`. This property can be overridden with the -`DOCKER_STACK_ORCHESTRATOR` environment variable, or the `--orchestrator` flag. - - ### Automatic proxy configuration for containers The property `proxies` specifies proxy environment variables to be automatically From 039018b6d3f4bb84ce0093e29ba4a5429a60c92b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Feb 2022 18:05:12 +0100 Subject: [PATCH 5/9] docs: remove deprecated orchestrator flags Removes the flags that have been deprecated or removed; - --default-stack-orchestrator - --kubernetes - --kubeconfig - --namespace - --orchestrator Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/context_create.md | 42 +++---------------- docs/reference/commandline/context_export.md | 17 ++++---- docs/reference/commandline/context_inspect.md | 17 ++------ docs/reference/commandline/context_update.md | 14 ------- docs/reference/commandline/stack.md | 2 - docs/reference/commandline/stack_deploy.md | 3 -- docs/reference/commandline/stack_ls.md | 3 -- docs/reference/commandline/stack_ps.md | 3 -- docs/reference/commandline/stack_rm.md | 9 ++-- docs/reference/commandline/stack_services.md | 3 -- docs/reference/commandline/version.md | 1 - 11 files changed, 22 insertions(+), 92 deletions(-) diff --git a/docs/reference/commandline/context_create.md b/docs/reference/commandline/context_create.md index c6e2d4303347..dceaadf82a17 100644 --- a/docs/reference/commandline/context_create.md +++ b/docs/reference/commandline/context_create.md @@ -21,14 +21,6 @@ cert Path to TLS certificate file key Path to TLS key file skip-tls-verify Skip TLS certificate validation -Kubernetes endpoint config: - -NAME DESCRIPTION -from Copy Kubernetes endpoint configuration from an existing context -config-file Path to a Kubernetes config file -context-override Overrides the context set in the kubernetes config file -namespace-override Overrides the namespace set in the kubernetes config file - Example: $ docker context create my-context \ @@ -36,15 +28,9 @@ $ docker context create my-context \ --docker "host=tcp://myserver:2376,ca=~/ca-file,cert=~/cert-file,key=~/key-file" Options: - --default-stack-orchestrator string Default orchestrator for - stack operations to use with - this context - (swarm|kubernetes|all) --description string Description of the context --docker stringToString set the docker endpoint (default []) - --kubernetes stringToString set the kubernetes endpoint - (default []) --from string Create the context from an existing context ``` @@ -55,17 +41,15 @@ configuration to connect to different clusters or single nodes. ## Examples -### Create a context with a docker and kubernetes endpoint +### Create a context with a docker endpoint To create a context from scratch provide the docker and, if required, kubernetes options. The example below creates the context `my-context` -with a docker endpoint of `/var/run/docker.sock` and a kubernetes configuration -sourced from the file `/home/me/my-kube-config`: +with a docker endpoint of `/var/run/docker.sock`: ```console $ docker context create \ --docker host=unix:///var/run/docker.sock \ - --kubernetes config-file=/home/me/my-kube-config \ my-context ``` @@ -92,32 +76,18 @@ $ source my-setup-script.sh $ docker context create my-context ``` -To source only the `docker` endpoint configuration from an existing context +To source the `docker` endpoint configuration from an existing context use the `--docker from=` option. The example below creates a new context named `my-context` using the docker endpoint configuration from -the existing context `existing-context` and a kubernetes configuration sourced -from the file `/home/me/my-kube-config`: +the existing context `existing-context`: ```console $ docker context create \ --docker from=existing-context \ - --kubernetes config-file=/home/me/my-kube-config \ - my-context -``` - -To source only the `kubernetes` configuration from an existing context use the -`--kubernetes from=` option. The example below creates a new -context named `my-context` using the kuberentes configuration from the existing -context `existing-context` and a docker endpoint of `/var/run/docker.sock`: - -```console -$ docker context create \ - --docker host=unix:///var/run/docker.sock \ - --kubernetes from=existing-context \ my-context ``` -Docker and Kubernetes endpoints configurations, as well as default stack -orchestrator and description can be modified with `docker context update`. +Docker endpoints configurations, as well as the description can be modified with +`docker context update`. Refer to the [`docker context update` reference](context_update.md) for details. diff --git a/docs/reference/commandline/context_export.md b/docs/reference/commandline/context_export.md index 4a1c8a16dfc5..1e8c581f8d2f 100644 --- a/docs/reference/commandline/context_export.md +++ b/docs/reference/commandline/context_export.md @@ -9,15 +9,16 @@ keywords: "context, export" ```markdown Usage: docker context export [OPTIONS] CONTEXT [FILE|-] -Export a context to a tar or kubeconfig file - -Options: - --kubeconfig Export as a kubeconfig file +Export a context to a tar archive FILE or a tar stream on STDOUT. ``` ## Description -Exports a context in a file that can then be used with `docker context import` -(or with `kubectl` if `--kubeconfig` is set). Default output filename is -`.dockercontext`, or `.kubeconfig` if `--kubeconfig` is set. -To export to `STDOUT`, you can run `docker context export my-context -`. +Exports a context to a file that can then be used with `docker context import`. + +The default output filename is `.dockercontext`. To export to `STDOUT`, +use `-` as filename, for example: + +```console +$ docker context export my-context - +``` diff --git a/docs/reference/commandline/context_inspect.md b/docs/reference/commandline/context_inspect.md index 10e3bd8a7c63..0b86829a9b4c 100644 --- a/docs/reference/commandline/context_inspect.md +++ b/docs/reference/commandline/context_inspect.md @@ -30,27 +30,16 @@ $ docker context inspect "local+aks" { "Name": "local+aks", "Metadata": { - "Description": "Local Docker Engine + Azure AKS endpoint", - "StackOrchestrator": "kubernetes" + "Description": "Local Docker Engine", + "StackOrchestrator": "swarm" }, "Endpoints": { "docker": { "Host": "npipe:////./pipe/docker_engine", "SkipTLSVerify": false - }, - "kubernetes": { - "Host": "https://simon-aks-***.hcp.uksouth.azmk8s.io:443", - "SkipTLSVerify": false, - "DefaultNamespace": "default" } }, - "TLSMaterial": { - "kubernetes": [ - "ca.pem", - "cert.pem", - "key.pem" - ] - }, + "TLSMaterial": {}, "Storage": { "MetadataPath": "C:\\Users\\simon\\.docker\\contexts\\meta\\cb6d08c0a1bfa5fe6f012e61a442788c00bed93f509141daff05f620fc54ddee", "TLSPath": "C:\\Users\\simon\\.docker\\contexts\\tls\\cb6d08c0a1bfa5fe6f012e61a442788c00bed93f509141daff05f620fc54ddee" diff --git a/docs/reference/commandline/context_update.md b/docs/reference/commandline/context_update.md index 8b1721df6437..c132952abfed 100644 --- a/docs/reference/commandline/context_update.md +++ b/docs/reference/commandline/context_update.md @@ -21,28 +21,14 @@ cert Path to TLS certificate file key Path to TLS key file skip-tls-verify Skip TLS certificate validation -Kubernetes endpoint config: - -NAME DESCRIPTION -from Copy Kubernetes endpoint configuration from an existing context -config-file Path to a Kubernetes config file -context-override Overrides the context set in the kubernetes config file -namespace-override Overrides the namespace set in the kubernetes config file - Example: $ docker context update my-context --description "some description" --docker "host=tcp://myserver:2376,ca=~/ca-file,cert=~/cert-file,key=~/key-file" Options: - --default-stack-orchestrator string Default orchestrator for - stack operations to use with - this context - (swarm|kubernetes|all) --description string Description of the context --docker stringToString set the docker endpoint (default []) - --kubernetes stringToString set the kubernetes endpoint - (default []) ``` ## Description diff --git a/docs/reference/commandline/stack.md b/docs/reference/commandline/stack.md index 00f33c6e39a3..c6431d247e18 100644 --- a/docs/reference/commandline/stack.md +++ b/docs/reference/commandline/stack.md @@ -13,8 +13,6 @@ Manage Docker stacks Options: --help Print usage - --kubeconfig string Kubernetes config file - --orchestrator string Orchestrator to use (swarm|kubernetes|all) Commands: deploy Deploy a new stack or update an existing stack diff --git a/docs/reference/commandline/stack_deploy.md b/docs/reference/commandline/stack_deploy.md index 858be7667657..cfd4501ae809 100644 --- a/docs/reference/commandline/stack_deploy.md +++ b/docs/reference/commandline/stack_deploy.md @@ -17,9 +17,6 @@ Aliases: Options: -c, --compose-file strings Path to a Compose file, or "-" to read from stdin --help Print usage - --kubeconfig string Kubernetes config file - --namespace string Kubernetes namespace to use - --orchestrator string Orchestrator to use (swarm|kubernetes|all) --prune Prune services that are no longer referenced --resolve-image string Query the registry to resolve image digest and supported platforms ("always"|"changed"|"never") (default "always") diff --git a/docs/reference/commandline/stack_ls.md b/docs/reference/commandline/stack_ls.md index 96a42e729873..453db5f588ad 100644 --- a/docs/reference/commandline/stack_ls.md +++ b/docs/reference/commandline/stack_ls.md @@ -17,9 +17,6 @@ Aliases: Options: --help Print usage --format string Pretty-print stacks using a Go template - --kubeconfig string Kubernetes config file - --namespace string Kubernetes namespace to use - --orchestrator string Orchestrator to use (swarm|kubernetes|all) ``` ## Description diff --git a/docs/reference/commandline/stack_ps.md b/docs/reference/commandline/stack_ps.md index a427eeb8a110..6328064892f5 100644 --- a/docs/reference/commandline/stack_ps.md +++ b/docs/reference/commandline/stack_ps.md @@ -15,11 +15,8 @@ Options: -f, --filter filter Filter output based on conditions provided --format string Pretty-print tasks using a Go template --help Print usage - --kubeconfig string Kubernetes config file - --namespace string Kubernetes namespace to use --no-resolve Do not map IDs to Names --no-trunc Do not truncate output - --orchestrator string Orchestrator to use (swarm|kubernetes|all) -q, --quiet Only display task IDs ``` diff --git a/docs/reference/commandline/stack_rm.md b/docs/reference/commandline/stack_rm.md index ff2a9019d842..9c90a08933af 100644 --- a/docs/reference/commandline/stack_rm.md +++ b/docs/reference/commandline/stack_rm.md @@ -16,9 +16,6 @@ Aliases: Options: --help Print usage - --kubeconfig string Kubernetes config file - --namespace string Kubernetes namespace to use - --orchestrator string Orchestrator to use (swarm|kubernetes|all) ``` ## Description @@ -36,7 +33,8 @@ Remove the stack from the swarm. ### Remove a stack -This will remove the stack with the name `myapp`. Services, networks, and secrets associated with the stack will be removed. +This will remove the stack with the name `myapp`. Services, networks, and secrets +associated with the stack will be removed. ```console $ docker stack rm myapp @@ -50,7 +48,8 @@ Removing network myapp_frontend ### Remove multiple stacks -This will remove all the specified stacks, `myapp` and `vossibility`. Services, networks, and secrets associated with all the specified stacks will be removed. +This will remove all the specified stacks, `myapp` and `vossibility`. Services, +networks, and secrets associated with all the specified stacks will be removed. ```console $ docker stack rm myapp vossibility diff --git a/docs/reference/commandline/stack_services.md b/docs/reference/commandline/stack_services.md index d689e728cb50..20aa1563b1ba 100644 --- a/docs/reference/commandline/stack_services.md +++ b/docs/reference/commandline/stack_services.md @@ -15,9 +15,6 @@ Options: -f, --filter filter Filter output based on conditions provided --format string Pretty-print services using a Go template --help Print usage - --kubeconfig string Kubernetes config file - --namespace string Kubernetes namespace to use - --orchestrator string Orchestrator to use (swarm|kubernetes|all) -q, --quiet Only display IDs ``` diff --git a/docs/reference/commandline/version.md b/docs/reference/commandline/version.md index 0ca8e19e7e22..2133de0d01ac 100644 --- a/docs/reference/commandline/version.md +++ b/docs/reference/commandline/version.md @@ -14,7 +14,6 @@ Show the Docker version information Options: -f, --format string Format the output using the given Go template --help Print usage - --kubeconfig string Kubernetes config file ``` ## Description From 6dcfbe66275981935da98b542dbf58ec026070ea Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 24 Feb 2022 11:01:22 +0100 Subject: [PATCH 6/9] docs: update list of supported filters for stack services Remove mentions of which options are supported by Kubernetes. Note that there's some filters remaining that were marked as "not supported by swarm": those filters need to be checked if this is accurate (and if so, those filters must be removed). Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/stack_services.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/reference/commandline/stack_services.md b/docs/reference/commandline/stack_services.md index 20aa1563b1ba..8be549c48a3a 100644 --- a/docs/reference/commandline/stack_services.md +++ b/docs/reference/commandline/stack_services.md @@ -60,23 +60,14 @@ dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c8 The currently supported filters are: * id / ID (`--filter id=7be5ei6sqeye`, or `--filter ID=7be5ei6sqeye`) - * Swarm: supported - * Kubernetes: not supported * label (`--filter label=key=value`) - * Swarm: supported - * Kubernetes: supported * mode (`--filter mode=replicated`, or `--filter mode=global`) * Swarm: not supported - * Kubernetes: supported * name (`--filter name=myapp_web`) - * Swarm: supported - * Kubernetes: supported * node (`--filter node=mynode`) * Swarm: not supported - * Kubernetes: supported * service (`--filter service=web`) * Swarm: not supported - * Kubernetes: supported ### Formatting From b7d0f5c66709ffa61645cdaf85d844f905b4da15 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 24 Feb 2022 11:13:50 +0100 Subject: [PATCH 7/9] docs: add more details to stack kubernetes deprecation Explicitly mention flags and environment variables that were removed, to make the deprecation more discoverable. Signed-off-by: Sebastiaan van Stijn --- docs/deprecated.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/deprecated.md b/docs/deprecated.md index bf2aa33293aa..db8971065589 100644 --- a/docs/deprecated.md +++ b/docs/deprecated.md @@ -197,9 +197,30 @@ to decrypt the private key, and store it un-encrypted to continue using it. ### Kubernetes stack and context support **Deprecated in Release: v20.10** +**Removed in Release: v21.xx** + +Following the deprecation of [Compose on Kubernetes](https://github.com/docker/compose-on-kubernetes), +support for Kubernetes in the `stack` and `context` commands has been removed from +the cli, and options related to this functionality are now either ignored, or may +produce an error. + +The following command-line flags are removed from the `docker context` subcommands: + +- `--default-stack-orchestrator` - swarm is now the only (and default) orchestrator for stacks. +- `--kubernetes` - the kubernetes endpoint can no longer be stored in `docker context`. +- `--kubeconfig` - exporting a context as a kubeconfig file is no longer supported. + +The output produced by the `docker context inspect` subcommand no longer contains +information about `StackOrchestrator` and `Kubernetes` endpoints for new contexts. + +The following command-line flags are removed from the `docker stack` subcommands: + +- `--kubeconfig` - using a kubeconfig file as context is no longer supported. +- `--namespace` - configuring the kubernetes namespace for stacks is no longer supported. +- `--orchestrator` - swarm is now the only (and default) orchestrator for stacks. -Following the deprecation of [Compose on Kubernetes](https://github.com/docker/compose-on-kubernetes), support for -Kubernetes in the `stack` and `context` commands in the docker CLI is now marked as deprecated as well. +The `DOCKER_STACK_ORCHESTRATOR`, `DOCKER_ORCHESTRATOR`, and `KUBECONFIG` environment +variables are no longer used, and ignored. ### Pulling images from non-compliant image registries From 6ea2767289d3ae7a65183da1758f4753d5053bd8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 24 Feb 2022 13:35:03 +0100 Subject: [PATCH 8/9] config: mark stackOrchestrator option as deprecated Signed-off-by: Sebastiaan van Stijn --- cli/command/defaultcontextstore_test.go | 4 +--- cli/config/configfile/file.go | 2 +- docs/deprecated.md | 3 ++- docs/reference/commandline/cli.md | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cli/command/defaultcontextstore_test.go b/cli/command/defaultcontextstore_test.go index 1bed50f60889..749d390b1cee 100644 --- a/cli/command/defaultcontextstore_test.go +++ b/cli/command/defaultcontextstore_test.go @@ -60,9 +60,7 @@ func TestDefaultContextInitializer(t *testing.T) { cli, err := NewDockerCli() assert.NilError(t, err) defer env.Patch(t, "DOCKER_HOST", "ssh://someswarmserver")() - cli.configFile = &configfile.ConfigFile{ - StackOrchestrator: "swarm", - } + cli.configFile = &configfile.ConfigFile{} ctx, err := ResolveDefaultContext(&cliflags.CommonOptions{ TLS: true, TLSOptions: &tlsconfig.Options{ diff --git a/cli/config/configfile/file.go b/cli/config/configfile/file.go index 98915bdf6dc5..1b07ccdba25c 100644 --- a/cli/config/configfile/file.go +++ b/cli/config/configfile/file.go @@ -45,7 +45,7 @@ type ConfigFile struct { PruneFilters []string `json:"pruneFilters,omitempty"` Proxies map[string]ProxyConfig `json:"proxies,omitempty"` Experimental string `json:"experimental,omitempty"` - StackOrchestrator string `json:"stackOrchestrator,omitempty"` + StackOrchestrator string `json:"stackOrchestrator,omitempty"` // Deprecated: swarm is now the default orchestrator, and this option is ignored. CurrentContext string `json:"currentContext,omitempty"` CLIPluginsExtraDirs []string `json:"cliPluginsExtraDirs,omitempty"` Plugins map[string]map[string]string `json:"plugins,omitempty"` diff --git a/docs/deprecated.md b/docs/deprecated.md index db8971065589..b7142d874084 100644 --- a/docs/deprecated.md +++ b/docs/deprecated.md @@ -220,7 +220,8 @@ The following command-line flags are removed from the `docker stack` subcommands - `--orchestrator` - swarm is now the only (and default) orchestrator for stacks. The `DOCKER_STACK_ORCHESTRATOR`, `DOCKER_ORCHESTRATOR`, and `KUBECONFIG` environment -variables are no longer used, and ignored. +variables, as well as the `stackOrchestrator` option in the `~/.docker/config.json` +cli configuration file are no longer used, and ignored. ### Pulling images from non-compliant image registries diff --git a/docs/reference/commandline/cli.md b/docs/reference/commandline/cli.md index 1175c7ba834c..cfa64960790f 100644 --- a/docs/reference/commandline/cli.md +++ b/docs/reference/commandline/cli.md @@ -273,7 +273,6 @@ various fields: "awesomereg.example.org": "hip-star", "unicorn.example.com": "vcbait" }, - "stackOrchestrator": "kubernetes", "plugins": { "plugin1": { "option": "value" From 467e650d4c75f078b4ac442789424be094e5d0cd Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 24 Feb 2022 13:36:01 +0100 Subject: [PATCH 9/9] formatter: mark KubernetesEndpoint templating option as deprecated Signed-off-by: Sebastiaan van Stijn --- cli/command/formatter/context.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/command/formatter/context.go b/cli/command/formatter/context.go index fd8409108c5b..fd0e67d6f469 100644 --- a/cli/command/formatter/context.go +++ b/cli/command/formatter/context.go @@ -75,6 +75,9 @@ func (c *clientContextContext) DockerEndpoint() string { return c.c.DockerEndpoint } +// KubernetesEndpoint returns the kubernetes endpoint. +// +// Deprecated: support for kubernetes endpoints in contexts has been removed, and this formatting option will always be empty. func (c *clientContextContext) KubernetesEndpoint() string { return "" }