From 1d48749c1cba64a2f06828300b2a35965e1cf98b Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Fri, 18 Feb 2022 09:57:37 +0100 Subject: [PATCH] warn user kubernetes is deprecated and options won't be stored in context Signed-off-by: Nicolas De Loof --- cli/command/context/create.go | 4 ++++ cli/command/context/update.go | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/cli/command/context/create.go b/cli/command/context/create.go index 80ef61681a..9f39f7d39c 100644 --- a/cli/command/context/create.go +++ b/cli/command/context/create.go @@ -3,6 +3,7 @@ package context import ( "bytes" "fmt" + "github.com/sirupsen/logrus" "text/tabwriter" "github.com/docker/cli/cli" @@ -107,6 +108,9 @@ func createNewContext(o *CreateOptions, stackOrchestrator command.Orchestrator, if dockerTLS != nil { contextTLSData.Endpoints[docker.DockerEndpoint] = *dockerTLS } + if len(o.Kubernetes) != 0 { + logrus.Warn("kubernetes orchestrator is deprecated") + } if err := validateEndpointsAndOrchestrator(contextMetadata); err != nil { return err } diff --git a/cli/command/context/update.go b/cli/command/context/update.go index 2d35135f25..55f775037d 100644 --- a/cli/command/context/update.go +++ b/cli/command/context/update.go @@ -3,6 +3,7 @@ package context import ( "bytes" "fmt" + "github.com/sirupsen/logrus" "text/tabwriter" "github.com/docker/cli/cli" @@ -15,11 +16,14 @@ import ( // UpdateOptions are the options used to update a context type UpdateOptions struct { - Name string - Description string + Name string + Description string + Docker map[string]string + + // Deprecated DefaultStackOrchestrator string - Docker map[string]string - Kubernetes map[string]string + // Deprecated + Kubernetes map[string]string } func longUpdateDescription() string { @@ -98,6 +102,9 @@ func RunUpdate(cli command.Cli, o *UpdateOptions) error { c.Endpoints[docker.DockerEndpoint] = dockerEP tlsDataToReset[docker.DockerEndpoint] = dockerTLS } + if len(o.Kubernetes) != 0 { + logrus.Warn("kubernetes orchestrator is deprecated") + } if err := validateEndpointsAndOrchestrator(c); err != nil { return err }