Documentation ¶
Overview ¶
Package cli implements a command line client for Inago. Cobra CLI is used as framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MainCmd contains the cobra.Command to execute inagoctl. MainCmd = &cobra.Command{ Use: "inagoctl", Short: "Inago orchestrates groups of units on Fleet clusters", Long: "Inago orchestrates groups of units on Fleet clusters", Run: mainRun, PersistentPreRun: func(cmd *cobra.Command, args []string) { fs = afero.Afero{Fs: afero.NewOsFs()} loggingConfig := logging.DefaultConfig() if globalFlags.Verbose { loggingConfig.LogLevel = "DEBUG" } newLogger = logging.NewLogger(loggingConfig) URL, err := url.Parse(globalFlags.FleetEndpoint) if err != nil { panic(err) } newFleetConfig := fleet.DefaultConfig() newFleetConfig.Endpoint = *URL newFleetConfig.Logger = newLogger if globalFlags.Tunnel != "" { newSSHTunnelConfig := fleet.DefaultSSHTunnelConfig() newSSHTunnelConfig.Endpoint = *URL newSSHTunnelConfig.KnownHostsFile = globalFlags.SSHKnownHostsFile newSSHTunnelConfig.Logger = newLogger newSSHTunnelConfig.StrictHostKeyChecking = globalFlags.SSHStrictHostKeyChecking newSSHTunnelConfig.Timeout = globalFlags.SSHTimeout newSSHTunnelConfig.Tunnel = globalFlags.Tunnel newSSHTunnelConfig.Username = globalFlags.SSHUsername newSSHTunnel, err := fleet.NewSSHTunnel(newSSHTunnelConfig) if err != nil { panic(err) } newFleetConfig.SSHTunnel = newSSHTunnel } newFleet, err = fleet.NewFleet(newFleetConfig) if err != nil { panic(err) } newTaskServiceConfig := task.DefaultConfig() newTaskServiceConfig.Logger = newLogger newTaskService = task.NewTaskService(newTaskServiceConfig) newControllerConfig := controller.DefaultConfig() newControllerConfig.Logger = newLogger newControllerConfig.Fleet = newFleet newControllerConfig.TaskService = newTaskService newController = controller.NewController(newControllerConfig) newCtx = context.Background() }, } )
Functions ¶
func FormatValidationError ¶
func FormatValidationError(err controller.ValidationError) string
FormatValidationError returns the CausingErrors formatted: Validation Error found:
- unit slice not found
- unit does not have group prefix
func IsInvalidArgumentsError ¶
IsInvalidArgumentsError checks whether the given command line arguments are valid
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.