Add events to kubectl (still need search function)

This commit is contained in:
Daniel Smith
2014-11-03 18:02:27 -08:00
parent 39fba7c8d5
commit 0b924ed9d9
5 changed files with 52 additions and 6 deletions

View File

@@ -110,6 +110,8 @@ Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
}
}
// TODO: remove this function and references to it-- errors it prints are
// very unhelpful because file/line number are wrong.
func checkErr(err error) {
if err != nil {
glog.Fatalf("%v", err)

View File

@@ -32,7 +32,7 @@ func (f *Factory) NewCmdGet(out io.Writer) *cobra.Command {
Long: `Display one or many resources.
Possible resources include pods (po), replication controllers (rc), services
(se) or minions (mi).
(se), minions (mi), or events (ev).
If you specify a Go template, you can use any fields defined for the API version
you are connecting to the server with.

View File

@@ -19,10 +19,11 @@ package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/meta"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/spf13/cobra"
)
// ResourceFromArgsOrFile expects two arguments or a valid file with a given type, and extracts
@@ -35,7 +36,7 @@ func ResourceFromArgsOrFile(cmd *cobra.Command, args []string, filename string,
}
if len(args) == 2 {
resource := args[0]
resource := kubectl.ExpandResourceShortcut(args[0])
namespace = getKubeNamespace(cmd)
name = args[1]
if len(name) == 0 || len(resource) == 0 {
@@ -70,7 +71,7 @@ func ResourceFromArgs(cmd *cobra.Command, args []string, mapper meta.RESTMapper)
usageError(cmd, "Must provide resource and name command line params")
}
resource := args[0]
resource := kubectl.ExpandResourceShortcut(args[0])
namespace = getKubeNamespace(cmd)
name = args[1]
if len(name) == 0 || len(resource) == 0 {
@@ -93,7 +94,7 @@ func ResourceOrTypeFromArgs(cmd *cobra.Command, args []string, mapper meta.RESTM
usageError(cmd, "Must provide resource or a resource and name as command line params")
}
resource := args[0]
resource := kubectl.ExpandResourceShortcut(args[0])
if len(resource) == 0 {
usageError(cmd, "Must provide resource or a resource and name as command line params")
}