mirror of
https://github.com/containers/podman.git
synced 2025-07-17 17:43:23 +08:00
Fix gofmt & golint
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #440 Approved by: baude
This commit is contained in:
@ -649,7 +649,7 @@ func (c *Container) ExecSession(id string) (*ExecSession, error) {
|
|||||||
return returnSession, nil
|
return returnSession, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// IPs() retrieves a container's IP addresses
|
// IPs retrieves a container's IP address(es)
|
||||||
// This will only be populated if the container is configured to created a new
|
// This will only be populated if the container is configured to created a new
|
||||||
// network namespace, and that namespace is presently active
|
// network namespace, and that namespace is presently active
|
||||||
func (c *Container) IPs() ([]net.IPNet, error) {
|
func (c *Container) IPs() ([]net.IPNet, error) {
|
||||||
@ -662,6 +662,10 @@ func (c *Container) IPs() ([]net.IPNet, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !c.config.CreateNetNS {
|
||||||
|
return errors.Wrapf(ErrInvalidArg, "container %s network namespace is not managed by libpod")
|
||||||
|
}
|
||||||
|
|
||||||
ips := make([]net.IPNet, 0, len(c.state.IPs))
|
ips := make([]net.IPNet, 0, len(c.state.IPs))
|
||||||
|
|
||||||
for _, ip := range c.state.IPs {
|
for _, ip := range c.state.IPs {
|
||||||
@ -686,6 +690,10 @@ func (c *Container) Routes() ([]types.Route, error) {
|
|||||||
|
|
||||||
routes := make([]types.Route, 0, len(c.state.Routes))
|
routes := make([]types.Route, 0, len(c.state.Routes))
|
||||||
|
|
||||||
|
if !c.config.CreateNetNS {
|
||||||
|
return errors.Wrapf(ErrInvalidArg, "container %s network namespace is not managed by libpod")
|
||||||
|
}
|
||||||
|
|
||||||
for _, route := range c.state.Routes {
|
for _, route := range c.state.Routes {
|
||||||
newRoute := types.Route{
|
newRoute := types.Route{
|
||||||
Dst: route.Dst,
|
Dst: route.Dst,
|
||||||
|
Reference in New Issue
Block a user