add create subcommand for priorityclass

This commit is contained in:
wackxu
2017-10-31 17:16:25 +08:00
parent 7f9f847ce9
commit 741c58be7f
12 changed files with 350 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ import (
"strings"
"time"
jsonpatch "github.com/evanphx/json-patch"
"github.com/evanphx/json-patch"
"github.com/golang/glog"
"github.com/spf13/cobra"
@@ -362,6 +362,15 @@ func GetFlagInt(cmd *cobra.Command, flag string) int {
return i
}
// Assumes the flag has a default value.
func GetFlagInt32(cmd *cobra.Command, flag string) int32 {
i, err := cmd.Flags().GetInt32(flag)
if err != nil {
glog.Fatalf("error accessing flag %s for command %s: %v", flag, cmd.Name(), err)
}
return i
}
// Assumes the flag has a default value.
func GetFlagInt64(cmd *cobra.Command, flag string) int64 {
i, err := cmd.Flags().GetInt64(flag)