mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
structs: Unify Volume and VolumeRequest
This commit is contained in:
@@ -1327,11 +1327,7 @@ func (a *ClientConfig) Merge(b *ClientConfig) *ClientConfig {
|
||||
}
|
||||
|
||||
if len(a.HostVolumes) == 0 && len(b.HostVolumes) != 0 {
|
||||
cc := make([]*structs.ClientHostVolumeConfig, len(b.HostVolumes))
|
||||
for k, v := range b.HostVolumes {
|
||||
cc[k] = v.Copy()
|
||||
}
|
||||
result.HostVolumes = cc
|
||||
result.HostVolumes = structs.CopySliceClientHostVolumeConfig(b.HostVolumes)
|
||||
} else if len(b.HostVolumes) != 0 {
|
||||
result.HostVolumes = structs.HostVolumeSliceMerge(a.HostVolumes, b.HostVolumes)
|
||||
}
|
||||
|
||||
@@ -749,7 +749,7 @@ func ApiTgToStructsTG(taskGroup *api.TaskGroup, tg *structs.TaskGroup) {
|
||||
continue
|
||||
}
|
||||
|
||||
vol := &structs.Volume{
|
||||
vol := &structs.VolumeRequest{
|
||||
Name: v.Name,
|
||||
Type: v.Type,
|
||||
ReadOnly: v.ReadOnly,
|
||||
@@ -757,10 +757,7 @@ func ApiTgToStructsTG(taskGroup *api.TaskGroup, tg *structs.TaskGroup) {
|
||||
Config: v.Config,
|
||||
}
|
||||
|
||||
tg.Volumes[k] = &structs.VolumeRequest{
|
||||
Volume: vol,
|
||||
Config: v.Config,
|
||||
}
|
||||
tg.Volumes[k] = vol
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user