Fix data race.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
574dfd8c19
commit
03aca5e82b
@ -442,11 +442,12 @@ func setOCIProcessArgs(g *generate.Generator, config *runtime.ContainerConfig, i
|
||||
// The following logic is migrated from https://github.com/moby/moby/blob/master/daemon/commit.go
|
||||
// TODO(random-liu): Clearly define the commands overwrite behavior.
|
||||
if len(command) == 0 {
|
||||
// Copy array to avoid data race.
|
||||
if len(args) == 0 {
|
||||
args = imageConfig.Cmd
|
||||
args = append([]string{}, imageConfig.Cmd...)
|
||||
}
|
||||
if command == nil {
|
||||
command = imageConfig.Entrypoint
|
||||
command = append([]string{}, imageConfig.Entrypoint...)
|
||||
}
|
||||
}
|
||||
if len(command) == 0 && len(args) == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user