Browse Source

Improvement: Docker one shot error message (#1666)

* In one shot, user would only specify one container?
Laurence Jones 2 years ago
parent
commit
21e5b0d6d0

+ 1 - 1
pkg/acquisition/modules/docker/docker.go

@@ -321,7 +321,7 @@ func (d *DockerSource) OneShotAcquisition(out chan types.Event, t *tomb.Tomb) er
 	t.Kill(nil)
 
 	if !foundOne {
-		return fmt.Errorf("no docker found, can't run one shot acquisition")
+		return fmt.Errorf("no container found named: %s, can't run one shot acquisition", d.Config.ContainerName[0])
 	}
 
 	return nil

+ 1 - 1
pkg/acquisition/modules/docker/docker_test.go

@@ -267,7 +267,7 @@ func TestOneShot(t *testing.T) {
 	}{
 		{
 			dsn:            "docker://non_exist_docker",
-			expectedErr:    "no docker found, can't run one shot acquisition",
+			expectedErr:    "no container found named: non_exist_docker, can't run one shot acquisition",
 			expectedOutput: "",
 			expectedLines:  0,
 			logType:        "test",