diff --git a/cmd/osc/osc.go b/cmd/osc/osc.go index 6bab970405e5..b4157c43ae02 100644 --- a/cmd/osc/osc.go +++ b/cmd/osc/osc.go @@ -4,11 +4,10 @@ import ( "fmt" "os" + "github.com/openshift/origin/pkg/api/latest" "github.com/openshift/origin/pkg/cmd/auth" - "github.com/openshift/origin/pkg/cmd/create" - "github.com/openshift/origin/pkg/cmd/deployment" - "github.com/openshift/origin/pkg/cmd/pod" "github.com/openshift/origin/pkg/cmd/setup" + kubectl "github.com/openshift/origin/pkg/kubectl/cmd" "github.com/openshift/origin/pkg/version" "github.com/spf13/cobra" ) @@ -58,12 +57,32 @@ func NewCmdOpenShiftClient(name string) *cobra.Command { } // Subcommands - cmd.AddCommand(create.NewCmdCreate("create")) - cmd.AddCommand(deployment.NewCmdDeployment("deployment")) - cmd.AddCommand(pod.NewCmdPod("pod")) + //cmd.AddCommand(create.NewCmdCreate("create")) + //cmd.AddCommand(deployment.NewCmdDeployment("deployment")) + //cmd.AddCommand(pod.NewCmdPod("pod")) cmd.AddCommand(setup.NewCmdSetup("setup")) cmd.AddCommand(auth.NewCmdLogin("login")) cmd.AddCommand(auth.NewCmdLogout("logout")) + // Exposes kubectl subcommands + cmd.PersistentFlags().StringP("server", "s", "", "Kubernetes apiserver to connect to") + cmd.PersistentFlags().StringP("auth-path", "a", os.Getenv("HOME")+"/.kubernetes_auth", "Path to the auth info file. If missing, prompt the user. Only used if using https.") + cmd.PersistentFlags().Bool("match-server-version", false, "Require server version to match client version") + cmd.PersistentFlags().String("api-version", latest.Version, "The version of the API to use against the server (used for viewing resources only)") + cmd.PersistentFlags().String("certificate-authority", "", "Path to a certificate file for the certificate authority") + cmd.PersistentFlags().String("client-certificate", "", "Path to a client certificate for TLS.") + cmd.PersistentFlags().String("client-key", "", "Path to a client key file for TLS.") + cmd.PersistentFlags().Bool("insecure-skip-tls-verify", false, "If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.") + + f := kubectl.NewFactory() + out := os.Stdout + //cmds.AddCommand(NewCmdVersion(out)) + //cmds.AddCommand(NewCmdProxy(out)) + cmd.AddCommand(f.NewCmdGet(out)) + cmd.AddCommand(f.NewCmdDescribe(out)) + cmd.AddCommand(f.NewCmdCreate(out)) + cmd.AddCommand(f.NewCmdUpdate(out)) + cmd.AddCommand(f.NewCmdDelete(out)) + return cmd }