From 09bc729b5071cda05bbee08ddc7f6c9b7cf4e4ef Mon Sep 17 00:00:00 2001 From: fanmin shi Date: Wed, 2 May 2018 13:26:25 -0700 Subject: [PATCH] operator-sdk/cmd: add up command --- commands/operator-sdk/cmd/root.go | 1 + commands/operator-sdk/cmd/up.go | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 commands/operator-sdk/cmd/up.go diff --git a/commands/operator-sdk/cmd/root.go b/commands/operator-sdk/cmd/root.go index 2f09596d755..4424872b0d3 100644 --- a/commands/operator-sdk/cmd/root.go +++ b/commands/operator-sdk/cmd/root.go @@ -25,6 +25,7 @@ func NewRootCmd() *cobra.Command { cmd.AddCommand(NewNewCmd()) cmd.AddCommand(NewBuildCmd()) cmd.AddCommand(NewGenerateCmd()) + cmd.AddCommand(NewUpCmd()) return cmd } diff --git a/commands/operator-sdk/cmd/up.go b/commands/operator-sdk/cmd/up.go new file mode 100644 index 00000000000..85daa12498f --- /dev/null +++ b/commands/operator-sdk/cmd/up.go @@ -0,0 +1,26 @@ +package cmd + +import "github.com/spf13/cobra" + +var ( + kubeConfig string +) + +func NewUpCmd() *cobra.Command { + upCmd := &cobra.Command{ + Use: "up [Flags]", + Short: "Launches the operator locally", + Long: `The operator-sdk up command launches the operator on the local machine +by building the operator binary with the ability to access a +kubernetes cluster using a Kubernete config file. +`, + Run: upFunc, + } + + upCmd.Flags().StringVar(&kubeConfig, "kubeconfig", "~/.kube/config", "The file path to kubernetes configuration file; default to \"~/.kube/config\"") + + return upCmd +} + +func upFunc(cmd *cobra.Command, args []string) { +}