diff --git a/cli/cmd/run.go b/cli/cmd/run.go index 8f3ea1d806..22de88d0b3 100644 --- a/cli/cmd/run.go +++ b/cli/cmd/run.go @@ -6,6 +6,7 @@ package cmd import ( "context" + "os" "strings" "github.com/elastic/e2e-testing/cli/config" @@ -78,7 +79,11 @@ func buildRunProfileCommand(key string, profile config.Profile) *cobra.Command { return &cobra.Command{ Use: key, Short: `Runs the ` + profile.Name + ` profile`, - Long: `Runs the ` + profile.Name + ` profile, spinning up the Services that compound it`, + Long: `Runs the ` + profile.Name + ` profile, spinning up the Services that compound it + +Example: + go run main.go run profile fleet -s elastic-agent:8.0.0-SNAPSHOT +`, Run: func(cmd *cobra.Command, args []string) { serviceManager := services.NewServiceManager() @@ -99,6 +104,13 @@ func buildRunProfileCommand(key string, profile config.Profile) *cobra.Command { for _, srv := range services { arr := strings.Split(srv, ":") + if len(arr) != 2 { + log.WithFields(log.Fields{ + "profile": key, + "services": servicesToRun, + }).Error("Unable to determine the :, please make sure to use a known docker tag format, eg. `elastic-agent:8.0.0-SNAPSHOT`") + os.Exit(1) + } image := arr[0] tag := arr[1]