mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
docker: support group allocated ports and host_networks (#8623)
* docker: support group allocated ports * docker: add new ports driver config to specify which group ports are mapped * docker: update port mapping docs
This commit is contained in:
@@ -334,6 +334,7 @@ func (tc *TaskConfig) EncodeConcreteDriverConfig(t interface{}) error {
|
||||
type Resources struct {
|
||||
NomadResources *structs.AllocatedTaskResources
|
||||
LinuxResources *LinuxResources
|
||||
Ports *structs.AllocatedPorts
|
||||
}
|
||||
|
||||
func (r *Resources) Copy() *Resources {
|
||||
@@ -347,6 +348,11 @@ func (r *Resources) Copy() *Resources {
|
||||
if r.LinuxResources != nil {
|
||||
res.LinuxResources = r.LinuxResources.Copy()
|
||||
}
|
||||
|
||||
if r.Ports != nil {
|
||||
ports := structs.AllocatedPorts(append(make([]structs.AllocatedPortMapping, 0, len(*r.Ports)), *r.Ports...))
|
||||
res.Ports = &ports
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user