Files
nomad/client/allocrunner/network_hook.go2
Nick Ethier e20fa7ccc1 Add network lifecycle management
Adds a new Prerun and Postrun hooks to manage set up of network namespaces
on linux. Work still needs to be done to make the code platform agnostic and
support Docker style network initalization.
2019-07-31 01:03:17 -04:00

29 lines
434 B
Plaintext

package allocrunner
import "github.com/hashicorp/nomad/nomad/structs"
type networkHook struct {
// alloc set by new func
alloc *structs.Allocation
networks []*structs.NetworkResource
}
func newNetworkHook() *networkHook {
return nil
}
func (n *networkHook) Name() string {
return "network"
}
func (n *networkHook) Prerun() error {
if len(n.networks) == 0 || n.networks[0].Mode == "host" {
return nil
}
return nil
}