mirror of
https://gitea.elkins.co/Networking/ccl.git
synced 2025-03-04 09:18:48 -06:00
Support array of ip addresses
This commit is contained in:
parent
05e011f76f
commit
370df4f53f
@ -188,6 +188,12 @@ func (c *Container) CreateCommands() cmd.Set {
|
||||
if c.Networks[i].IPv6Address != nil {
|
||||
ips = append(ips, c.Networks[i].IPv6Address)
|
||||
}
|
||||
for _, ip := range c.Networks[i].IPv4Addresses {
|
||||
ips = append(ips, ip)
|
||||
}
|
||||
for _, ip := range c.Networks[i].IPv6Addresses {
|
||||
ips = append(ips, ip)
|
||||
}
|
||||
nets[c.Networks[i].Name] = types.PerNetworkOptions{
|
||||
StaticIPs: ips,
|
||||
InterfaceName: c.Networks[i].Name,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
Package network houses configured default metadata. Items defined for
|
||||
a `network.Network` struct serve as default values for container network
|
||||
definitions (based on the nework Name).
|
||||
definitions (based on the network Name).
|
||||
|
||||
Copyright © 2022 Joel D. Elkins <joel@elkins.co>
|
||||
|
||||
@ -37,9 +37,11 @@ import (
|
||||
// configuration omits DNS servers or the IPv6 flag, then the stand alone
|
||||
// definition values will be applied for the container when it is created.
|
||||
type Network struct {
|
||||
Name string `toml:"name"`
|
||||
DNS []net.IP `toml:"dns,omitempty"`
|
||||
IPv6 null.Bool `toml:"ipv6,omitempty"`
|
||||
IPv4Address net.IP `toml:"ipv4_address,omitempty"`
|
||||
IPv6Address net.IP `toml:"ipv6_address,omitempty"`
|
||||
Name string `toml:"name"`
|
||||
DNS []net.IP `toml:"dns,omitempty"`
|
||||
IPv6 null.Bool `toml:"ipv6,omitempty"`
|
||||
IPv4Address net.IP `toml:"ipv4_address,omitempty"`
|
||||
IPv6Address net.IP `toml:"ipv6_address,omitempty"`
|
||||
IPv4Addresses []net.IP `toml:"ipv4_addresses,omitempty"`
|
||||
IPv6Addresses []net.IP `toml:"ipv6_addresses,omitempty"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user