Skip to content

Commit

Permalink
osc create|get|describe|update|delete through kubectl subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianofranz committed Nov 3, 2014
1 parent 03a8ea0 commit da1b9c5
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions cmd/osc/osc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
}

0 comments on commit da1b9c5

Please sign in to comment.