common

package
v3.6.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bold      = 1
	FgBlack   = 30
	FgRed     = 31
	FgGreen   = 32
	FgYellow  = 33
	FgBlue    = 34
	FgMagenta = 35
	FgCyan    = 36
	FgWhite   = 37
	FgDefault = 39
)

ANSI escape codes

Variables

View Source
var (
	JobStatusIconMap         map[wfv1.NodePhase]string
	NodeTypeIconMap          map[wfv1.NodeType]string
	WorkflowConditionIconMap map[wfv1.ConditionType]string
	NoColor                  bool
	NoUtf8                   bool
)

Global variables

Functions

func LogWorkflow

func LogWorkflow(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace, workflow, podName, grep, selector string, logOptions *corev1.PodLogOptions) error

func PrintWorkflowHelper

func PrintWorkflowHelper(wf *wfv1.Workflow, getArgs GetFlags) string

func WaitWatchOrLog

func WaitWatchOrLog(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, workflowNames []string, cliSubmitOpts CliSubmitOpts) error

func WaitWorkflows

func WaitWorkflows(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, workflowNames []string, ignoreNotFound, quiet bool)

waitWorkflows waits for the given workflowNames.

func WatchWorkflow

func WatchWorkflow(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, workflow string, getArgs GetFlags) error

Types

type CliSubmitOpts

type CliSubmitOpts struct {
	Output        EnumFlagValue // --output
	Wait          bool          // --wait
	Watch         bool          // --watch
	Log           bool          // --log
	Strict        bool          // --strict
	Priority      *int32        // --priority
	GetArgs       GetFlags
	ScheduledTime string   // --scheduled-time
	Parameters    []string // --parameter
}

CliSubmitOpts holds submission options specific to CLI submission (e.g. controlling output)

func NewCliSubmitOpts

func NewCliSubmitOpts() CliSubmitOpts

type EnumFlagValue

type EnumFlagValue struct {
	AllowedValues []string
	Value         string
}

EnumFlagValue represents a CLI flag that can take one of a fixed set of values, and validates that the provided value is one of the allowed values. There's several libraries for this (e.g. https://github.com/thediveo/enumflag), but they're overkill.

func NewPrintWorkflowOutputValue

func NewPrintWorkflowOutputValue(value string) EnumFlagValue

func (*EnumFlagValue) Set

func (e *EnumFlagValue) Set(v string) error

func (*EnumFlagValue) String

func (e *EnumFlagValue) String() string

func (*EnumFlagValue) Type

func (e *EnumFlagValue) Type() string

func (*EnumFlagValue) Usage

func (e *EnumFlagValue) Usage() string

type GetFlags

type GetFlags struct {
	Output                  EnumFlagValue
	NodeFieldSelectorString string

	// Only used for backwards compatibility
	Status string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL