mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
Add events to kubectl (still need search function)
This commit is contained in:
@@ -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)
|
||||
|
@@ -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.
|
||||
|
@@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user