1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #38924 from tiborvass/fix-empty-warnings

ContainerCreate shouldn't return warnings=nil
This commit is contained in:
Tibor Vass 2019-03-21 17:20:54 -07:00 committed by GitHub
commit 02ec758372
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,6 +96,10 @@ func (daemon *Daemon) containerCreate(opts createOpts) (containertypes.Container
} }
containerActions.WithValues("create").UpdateSince(start) containerActions.WithValues("create").UpdateSince(start)
if warnings == nil {
warnings = make([]string, 0) // Create an empty slice to avoid https://github.com/moby/moby/issues/38222
}
return containertypes.ContainerCreateCreatedBody{ID: container.ID, Warnings: warnings}, nil return containertypes.ContainerCreateCreatedBody{ID: container.ID, Warnings: warnings}, nil
} }