Documentation
¶
Index ¶
- Constants
- func Fatal(err error, code int)
- func GetClientConfig(cmd *cobra.Command) (clientcmd.ClientConfig, error)
- func GetCronDynamicConfig(cmd *cobra.Command) *configv1alpha1.CronExecutionConfig
- func GetCtrlContext() controllercontext.Context
- func GetDynamicConfig(ctx context.Context, cmd *cobra.Command, name configv1alpha1.ConfigName, ...) error
- func GetFlagBool(cmd *cobra.Command, flag string) bool
- func GetFlagBoolIfExists(cmd *cobra.Command, flag string) (val bool, ok bool)
- func GetFlagInt64(cmd *cobra.Command, flag string) int64
- func GetFlagString(cmd *cobra.Command, flag string) string
- func GetKubeConfig(cmd *cobra.Command) (*rest.Config, error)
- func GetNamespace(cmd *cobra.Command) (string, error)
- func GetOutputFormat(cmd *cobra.Command) printer.OutputFormat
- func NewContext(cmd *cobra.Command) (controllercontext.Context, error)
- func PrepareExample(example string) string
- func PrerunWithKubeconfig(cmd *cobra.Command, _ []string) error
- func SetCtrlContext(cc controllercontext.Context)
- func SetupCtrlContext(cmd *cobra.Command) error
- type RunEFunc
Constants ¶
const (
// CommandName is the expected entrypoint of the root command.
CommandName = "furiko"
)
const (
DefaultErrorExitCode = 1
)
Variables ¶
This section is empty.
Functions ¶
func GetClientConfig ¶
func GetClientConfig(cmd *cobra.Command) (clientcmd.ClientConfig, error)
GetClientConfig loads the ClientConfig after parsing relevant flags.
func GetCronDynamicConfig ¶
func GetCronDynamicConfig(cmd *cobra.Command) *configv1alpha1.CronExecutionConfig
GetCronDynamicConfig returns the cron dynamic config.
func GetCtrlContext ¶
func GetCtrlContext() controllercontext.Context
GetCtrlContext retrieves the common context.
func GetDynamicConfig ¶
func GetDynamicConfig(ctx context.Context, cmd *cobra.Command, name configv1alpha1.ConfigName, out interface{}) error
GetDynamicConfig loads the dynamic config by name and unmarshals to out. TODO(irvinlim): If the current user does not have permissions to read the ConfigMap, or the ConfigMap uses a different name/namespace, we should gracefully handle this case.
func GetFlagBool ¶
GetFlagBool gets the boolean value of a flag.
func GetFlagBoolIfExists ¶
GetFlagBoolIfExists gets the boolean value of a flag if it exists.
func GetFlagInt64 ¶
GetFlagInt64 gets the int64 value of a flag.
func GetFlagString ¶
GetFlagString gets the string value of a flag.
func GetKubeConfig ¶
GetKubeConfig returns the desired kubeconfig.
func GetNamespace ¶
GetNamespace returns the namespace to use depending on what was defined in the flags.
func GetOutputFormat ¶
func GetOutputFormat(cmd *cobra.Command) printer.OutputFormat
GetOutputFormat returns the output format as parsed by the flag.
func NewContext ¶
func NewContext(cmd *cobra.Command) (controllercontext.Context, error)
NewContext returns a common context from the cobra command.
func PrepareExample ¶
PrepareExample replaces the root command name and indents all lines.
func PrerunWithKubeconfig ¶
PrerunWithKubeconfig is a pre-run function that will set up the common context when kubeconfig is needed.
func SetCtrlContext ¶
func SetCtrlContext(cc controllercontext.Context)
SetCtrlContext explicitly sets the common context.
func SetupCtrlContext ¶
SetupCtrlContext sets up the common context. TODO(irvinlim): We currently reuse controllercontext, but most of it is unusable for CLI interfaces. We should create a new common context as needed.