mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-09 08:26:47 +00:00
* Adds depends_on fields to compose YAML * Updates parsing code to copy across depends_on field to openfaas service from compose service definition * Adds algorithm and unit tests for finding order * Applies order to up.go command * Makes unit testing on MacOS possible through build directives Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
20 lines
406 B
Go
20 lines
406 B
Go
// +build linux
|
|
|
|
package cninetwork
|
|
|
|
import "github.com/vishvananda/netlink"
|
|
|
|
func linkToNetDev(link netlink.Link) (Dev, error) {
|
|
|
|
addrs, err := netlink.AddrList(link, netlink.FAMILY_V4)
|
|
if err != nil {
|
|
return Dev{}, err
|
|
}
|
|
|
|
netDev := Dev{Name: link.Attrs().Name, MAC: link.Attrs().HardwareAddr}
|
|
for _, addr := range addrs {
|
|
netDev.CIDRs = append(netDev.CIDRs, addr.IPNet)
|
|
}
|
|
return netDev, nil
|
|
}
|