Deprecate Kubernetes stack support

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
(cherry picked from commit c05f0f5957)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Mathieu Champlon 2021-06-29 14:48:14 +02:00 committed by Sebastiaan van Stijn
parent b639ea8b89
commit 0793f96394
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
5 changed files with 9 additions and 0 deletions

View File

@ -69,7 +69,9 @@ func NewStackCommand(dockerCli command.Cli) *cobra.Command {
flags := cmd.PersistentFlags() flags := cmd.PersistentFlags()
flags.String("kubeconfig", "", "Kubernetes config file") flags.String("kubeconfig", "", "Kubernetes config file")
flags.SetAnnotation("kubeconfig", "kubernetes", nil) flags.SetAnnotation("kubeconfig", "kubernetes", nil)
flags.SetAnnotation("kubeconfig", "deprecated", nil)
flags.String("orchestrator", "", "Orchestrator to use (swarm|kubernetes|all)") flags.String("orchestrator", "", "Orchestrator to use (swarm|kubernetes|all)")
flags.SetAnnotation("orchestrator", "deprecated", nil)
return cmd return cmd
} }

View File

@ -50,6 +50,7 @@ func NewOptions(flags *flag.FlagSet, orchestrator command.Orchestrator) Options
func AddNamespaceFlag(flags *flag.FlagSet) { func AddNamespaceFlag(flags *flag.FlagSet) {
flags.String("namespace", "", "Kubernetes namespace to use") flags.String("namespace", "", "Kubernetes namespace to use")
flags.SetAnnotation("namespace", "kubernetes", nil) flags.SetAnnotation("namespace", "kubernetes", nil)
flags.SetAnnotation("namespace", "deprecated", nil)
} }
// WrapCli wraps command.Cli with kubernetes specifics // WrapCli wraps command.Cli with kubernetes specifics

View File

@ -30,8 +30,10 @@ func newListCommand(dockerCli command.Cli, common *commonOptions) *cobra.Command
flags.StringVar(&opts.Format, "format", "", "Pretty-print stacks using a Go template") flags.StringVar(&opts.Format, "format", "", "Pretty-print stacks using a Go template")
flags.StringSliceVar(&opts.Namespaces, "namespace", []string{}, "Kubernetes namespaces to use") flags.StringSliceVar(&opts.Namespaces, "namespace", []string{}, "Kubernetes namespaces to use")
flags.SetAnnotation("namespace", "kubernetes", nil) flags.SetAnnotation("namespace", "kubernetes", nil)
flags.SetAnnotation("namespace", "deprecated", nil)
flags.BoolVarP(&opts.AllNamespaces, "all-namespaces", "", false, "List stacks from all Kubernetes namespaces") flags.BoolVarP(&opts.AllNamespaces, "all-namespaces", "", false, "List stacks from all Kubernetes namespaces")
flags.SetAnnotation("all-namespaces", "kubernetes", nil) flags.SetAnnotation("all-namespaces", "kubernetes", nil)
flags.SetAnnotation("all-namespaces", "deprecated", nil)
return cmd return cmd
} }

View File

@ -114,6 +114,7 @@ func NewVersionCommand(dockerCli command.Cli) *cobra.Command {
flags.StringVarP(&opts.format, "format", "f", "", "Format the output using the given Go template") flags.StringVarP(&opts.format, "format", "f", "", "Format the output using the given Go template")
flags.StringVar(&opts.kubeConfig, "kubeconfig", "", "Kubernetes config file") flags.StringVar(&opts.kubeConfig, "kubeconfig", "", "Kubernetes config file")
flags.SetAnnotation("kubeconfig", "kubernetes", nil) flags.SetAnnotation("kubeconfig", "kubernetes", nil)
flags.SetAnnotation("kubeconfig", "deprecated", nil)
return cmd return cmd
} }

View File

@ -199,6 +199,9 @@ func genFlagResult(flags *pflag.FlagSet) []cmdOption {
if _, ok := flag.Annotations["experimental"]; ok { if _, ok := flag.Annotations["experimental"]; ok {
opt.Experimental = true opt.Experimental = true
} }
if _, ok := flag.Annotations["deprecated"]; ok {
opt.Deprecated = true
}
if v, ok := flag.Annotations["version"]; ok { if v, ok := flag.Annotations["version"]; ok {
opt.MinAPIVersion = v[0] opt.MinAPIVersion = v[0]
} }