Improvement: Docker one shot error message (#1666)

* In one shot, user would only specify one container?
This commit is contained in:
Laurence Jones 2022-09-27 15:20:30 +01:00 committed by GitHub
parent 0708073a0c
commit 21e5b0d6d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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",