forked from Azure/aks-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add "get-versions" command to replace "orchestrators" (Azure#448)
* feat: "get-versions" command to replace "orchestrators" * docs: replace mentions of "aks-engine orchestrators" command
- Loading branch information
Showing
9 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
const ( | ||
getVersionsName = "get-versions" | ||
getVersionsShortDescription = "Display info about supported Kubernetes versions" | ||
getVersionsLongDescription = "Display supported Kubernetes versions and upgrade versions" | ||
) | ||
|
||
func newGetVersionsCmd() *cobra.Command { | ||
oc := orchestratorsCmd{} | ||
|
||
command := &cobra.Command{ | ||
Use: getVersionsName, | ||
Short: getVersionsShortDescription, | ||
Long: getVersionsLongDescription, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return oc.run(cmd, args) | ||
}, | ||
} | ||
|
||
f := command.Flags() | ||
oc.orchestrator = "Kubernetes" // orchestrator is always Kubernetes | ||
f.StringVar(&oc.version, "version", "", "Kubernetes version (optional)") | ||
f.BoolVar(&oc.windows, "windows", false, "Kubernetes cluster with Windows nodes (optional)") | ||
|
||
return command | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
package cmd | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("The get-versions command", func() { | ||
It("should create a get-versions command", func() { | ||
output := newGetVersionsCmd() | ||
|
||
Expect(output.Use).Should(Equal(getVersionsName)) | ||
Expect(output.Short).Should(Equal(getVersionsShortDescription)) | ||
Expect(output.Long).Should(Equal(getVersionsLongDescription)) | ||
Expect(output.Flags().Lookup("orchestrator")).To(BeNil()) | ||
Expect(output.Flags().Lookup("version")).NotTo(BeNil()) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters