Documentation
¶
Overview ¶
Package cmd provides functionally common to various argo CLIs
Index ¶
- func CmdContextWithLogger(cmd *cobra.Command, logLevel, logType string) (context.Context, logging.Logger, error)
- func GetGLogLevel() string
- func IsURL(u string) bool
- func MustIsDir(ctx context.Context, filePath string) bool
- func NewVersionCmd(cliName string) *cobra.Command
- func ParseLabels(labelSpec interface{}) (map[string]string, error)
- func PrintVersion(cliName string, version wfv1.Version, short bool)
- func PrintVersionMismatchWarning(ctx context.Context, clientVersion wfv1.Version, serverVersion string)
- func SetGLogLevel(glogLevel int)
- func SetLogrusFormatter(logType logging.LogType)
- func SetLogrusLevel(level logging.Level)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CmdContextWithLogger ¶
func CmdContextWithLogger(cmd *cobra.Command, logLevel, logType string) (context.Context, logging.Logger, error)
Ensures we have a logger at the specified level
func GetGLogLevel ¶
func GetGLogLevel() string
func MustIsDir ¶
MustIsDir returns whether or not the given filePath is a directory. Exits if path does not exist
func NewVersionCmd ¶
NewVersionCmd returns a new `version` command to be used as a sub-command to root
func ParseLabels ¶
ParseLabels turns a string representation of a label set into a map[string]string
func PrintVersionMismatchWarning ¶
func PrintVersionMismatchWarning(ctx context.Context, clientVersion wfv1.Version, serverVersion string)
PrintVersionMismatchWarning detects if there's a mismatch between the client and server versions and prints a warning if so
func SetGLogLevel ¶
func SetGLogLevel(glogLevel int)
SetGLogLevel set the glog level for the k8s go-client this is taken from argoproj/pkg but uses v2 of klog here to be compatible with k8s clients v0.19.x and above
func SetLogrusFormatter ¶
SetLogrusFormatter sets the logrus formatter to match the given logging.LogType. This is needed because argoproj/pkg uses logrus internally (e.g. stats package).
func SetLogrusLevel ¶
SetLogrusLevel sets the logrus log level to match the given logging.Level. This is needed because argoproj/pkg uses logrus internally (e.g. stats package).
Types ¶
This section is empty.