From 3e7d4bee2eb846073c33b36e747e38515660a4d2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 11 Jan 2018 18:30:50 +0100 Subject: [PATCH 1/2] Fix docs YAML generation setting "kubernetes" for "swarm" Due to a copy/paste error, commands annotated with "swarm" were incorrectly setting the "kubernetes" property. Signed-off-by: Sebastiaan van Stijn Upstream-commit: 6be06a3db2194e0821eec6f6e9bf78c71e360ddc Component: cli --- components/cli/docs/yaml/yaml.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cli/docs/yaml/yaml.go b/components/cli/docs/yaml/yaml.go index d909e45336..8e42e25d8f 100644 --- a/components/cli/docs/yaml/yaml.go +++ b/components/cli/docs/yaml/yaml.go @@ -123,7 +123,7 @@ func GenYamlCustom(cmd *cobra.Command, w io.Writer) error { cliDoc.Kubernetes = true } if _, ok := curr.Annotations["swarm"]; ok && !cliDoc.Swarm { - cliDoc.Kubernetes = true + cliDoc.Swarm = true } } @@ -208,7 +208,7 @@ func genFlagResult(flags *pflag.FlagSet) []cmdOption { opt.Kubernetes = true } if _, ok := flag.Annotations["swarm"]; ok { - opt.Kubernetes = true + opt.Swarm = true } result = append(result, opt) From 5127f79a8868e5d077840d4b53ce360c393be9ca Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 11 Jan 2018 21:16:37 +0100 Subject: [PATCH 2/2] Remove aliases for orchestrator Prefer "strict" values for orchestrator, as it's easier to add aliases (if we think it's needed) than to remove them later. Signed-off-by: Sebastiaan van Stijn Upstream-commit: a812995f9834ddd1ac8c9ee8ef6409594ea84481 Component: cli --- components/cli/cli/command/orchestrator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cli/cli/command/orchestrator.go b/components/cli/cli/command/orchestrator.go index 4efe623c29..d27bd6c1fa 100644 --- a/components/cli/cli/command/orchestrator.go +++ b/components/cli/cli/command/orchestrator.go @@ -21,9 +21,9 @@ const ( func normalize(flag string) Orchestrator { switch flag { - case "kubernetes", "k8s": + case "kubernetes": return OrchestratorKubernetes - case "swarm", "swarmkit": + case "swarm": return OrchestratorSwarm default: return orchestratorUnset