warn user kubernetes is deprecated and options won't be stored in context

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2022-02-18 09:57:37 +01:00
parent 7b9580df51
commit 1d48749c1c
2 changed files with 15 additions and 4 deletions

View File

@ -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
}

View File

@ -3,6 +3,7 @@ package context
import (
"bytes"
"fmt"
"github.com/sirupsen/logrus"
"text/tabwriter"
"github.com/docker/cli/cli"
@ -17,8 +18,11 @@ import (
type UpdateOptions struct {
Name string
Description string
DefaultStackOrchestrator string
Docker map[string]string
// Deprecated
DefaultStackOrchestrator string
// Deprecated
Kubernetes map[string]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
}