mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-20 22:59:42 -05:00
fix: add nil check of DriverConfig (#315)
This commit is contained in:
parent
1e55894715
commit
62827ae478
1 changed files with 9 additions and 6 deletions
|
|
@ -269,13 +269,16 @@ func getDockerContainerMounts(container types.ContainerJSON) []map[string]interf
|
|||
"volume": v,
|
||||
})
|
||||
}
|
||||
opt := map[string]interface{}{
|
||||
"no_copy": mount.VolumeOptions.NoCopy,
|
||||
"labels": labels,
|
||||
}
|
||||
if mount.VolumeOptions.DriverConfig != nil {
|
||||
opt["driver_name"] = mount.VolumeOptions.DriverConfig.Name
|
||||
opt["driver_options"] = mount.VolumeOptions.DriverConfig.Options
|
||||
}
|
||||
m["volume_options"] = []map[string]interface{}{
|
||||
{
|
||||
"no_copy": mount.VolumeOptions.NoCopy,
|
||||
"labels": labels,
|
||||
"driver_name": mount.VolumeOptions.DriverConfig.Name,
|
||||
"driver_options": mount.VolumeOptions.DriverConfig.Options,
|
||||
},
|
||||
opt,
|
||||
}
|
||||
}
|
||||
if mount.TmpfsOptions != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue