Documentation ¶
Index ¶
- func BuildConfig(master, kubeconfig string) (*rest.Config, error)
- func CaptureOutput(r *os.File, oldStdout *os.File) string
- func CreateJobCommand(ctx context.Context, config *rest.Config, ns, name string, action vcbus.Action) error
- func CreateQueueCommand(vcClient *versioned.Clientset, ns, name string, action vcbus.Action) error
- func CreateTestServer(response interface{}) *httptest.Server
- func HomeDir() string
- func HumanDuration(d time.Duration) string
- func InitFlags(cmd *cobra.Command, cf *CommonFlags)
- func PopulateResourceListV1(spec string) (v1.ResourceList, error)
- func RedirectStdout() (*os.File, *os.File)
- func TranslateTimestampSince(timestamp metav1.Time) string
- type CommonFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConfig ¶
BuildConfig builds the configure file for command lines.
func CaptureOutput ¶ added in v1.10.0
CaptureOutput reads from r until EOF and returns the result as a string.
func CreateJobCommand ¶
func CreateJobCommand(ctx context.Context, config *rest.Config, ns, name string, action vcbus.Action) error
CreateJobCommand executes a command such as resume/suspend.
func CreateQueueCommand ¶ added in v1.0.0
CreateQueueCommand executes a command such as open/close
func CreateTestServer ¶ added in v1.10.0
CreateTestServer creates an HTTP server that responds with the given response.
func HumanDuration ¶
HumanDuration translate time.Duration to human readable time string.
func InitFlags ¶
func InitFlags(cmd *cobra.Command, cf *CommonFlags)
InitFlags initializes the common flags for most command lines.
func PopulateResourceListV1 ¶
func PopulateResourceListV1(spec string) (v1.ResourceList, error)
PopulateResourceListV1 takes strings of form <resourceName1>=<value1>,<resourceName2>=<value2> and returns ResourceList.
func RedirectStdout ¶ added in v1.10.0
RedirectStdout redirects os.Stdout to a pipe and returns the read and write ends of the pipe.
func TranslateTimestampSince ¶
TranslateTimestampSince translates the time stamp.
Types ¶
type CommonFlags ¶
CommonFlags are the flags that most command lines have.