diff --git a/libnetwork/drivers/macvlan/macvlan.go b/libnetwork/drivers/macvlan/macvlan.go index 119c885393..d455affa56 100644 --- a/libnetwork/drivers/macvlan/macvlan.go +++ b/libnetwork/drivers/macvlan/macvlan.go @@ -17,7 +17,7 @@ const ( vethLen = 7 containerVethPrefix = "eth" vethPrefix = "veth" - macvlanType = "macvlan" // driver type name + driverName = "macvlan" // driver type name modePrivate = "private" // macvlan mode private modeVepa = "vepa" // macvlan mode vepa modeBridge = "bridge" // macvlan mode bridge @@ -69,7 +69,7 @@ func Init(dc driverapi.DriverCallback, config map[string]interface{}) error { return err } - return dc.RegisterDriver(macvlanType, d, c) + return dc.RegisterDriver(driverName, d, c) } func (d *driver) NetworkAllocate(id string, option map[string]string, ipV4Data, ipV6Data []driverapi.IPAMData) (map[string]string, error) { @@ -85,7 +85,7 @@ func (d *driver) EndpointOperInfo(nid, eid string) (map[string]interface{}, erro } func (d *driver) Type() string { - return macvlanType + return driverName } func (d *driver) IsBuiltIn() bool { diff --git a/libnetwork/drivers/macvlan/macvlan_endpoint.go b/libnetwork/drivers/macvlan/macvlan_endpoint.go index 8d4390f779..dd1cfe1acb 100644 --- a/libnetwork/drivers/macvlan/macvlan_endpoint.go +++ b/libnetwork/drivers/macvlan/macvlan_endpoint.go @@ -47,7 +47,7 @@ func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo, if opt, ok := epOptions[netlabel.PortMap]; ok { if _, ok := opt.([]types.PortBinding); ok { if len(opt.([]types.PortBinding)) > 0 { - logrus.Warnf("%s driver does not support port mappings", macvlanType) + logrus.Warnf("macvlan driver does not support port mappings") } } } @@ -55,7 +55,7 @@ func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo, if opt, ok := epOptions[netlabel.ExposedPorts]; ok { if _, ok := opt.([]types.TransportPort); ok { if len(opt.([]types.TransportPort)) > 0 { - logrus.Warnf("%s driver does not support port exposures", macvlanType) + logrus.Warnf("macvlan driver does not support port exposures") } } } diff --git a/libnetwork/drivers/macvlan/macvlan_network.go b/libnetwork/drivers/macvlan/macvlan_network.go index 50f1a086a5..2ed8069195 100644 --- a/libnetwork/drivers/macvlan/macvlan_network.go +++ b/libnetwork/drivers/macvlan/macvlan_network.go @@ -78,8 +78,9 @@ func (d *driver) createNetwork(config *configuration) (bool, error) { return false, err } config.CreatedSlaveLink = true + // notify the user in logs that they have limited communications - logrus.Debugf("Empty -o parent= limit communications to other containers inside of network: %s", + logrus.Debugf("Empty -o parent= flags limit communications to other containers inside of network: %s", config.Parent) } else { // if the subinterface parent_iface.vlan_id checks do not pass, return err. diff --git a/libnetwork/drivers/macvlan/macvlan_setup.go b/libnetwork/drivers/macvlan/macvlan_setup.go index 7415a07a27..ec40207d41 100644 --- a/libnetwork/drivers/macvlan/macvlan_setup.go +++ b/libnetwork/drivers/macvlan/macvlan_setup.go @@ -31,7 +31,7 @@ func createMacVlan(containerIfName, parent, macvlanMode string) (string, error) // Get the link for the master index (Example: the docker host eth iface) parentLink, err := ns.NlHandle().LinkByName(parent) if err != nil { - return "", fmt.Errorf("error occurred looking up the %s parent iface %s error: %s", macvlanType, parent, err) + return "", fmt.Errorf("error occurred looking up the macvlan parent iface %s error: %s", parent, err) } // Create a macvlan link macvlan := &netlink.Macvlan{ @@ -43,7 +43,7 @@ func createMacVlan(containerIfName, parent, macvlanMode string) (string, error) } if err := ns.NlHandle().LinkAdd(macvlan); err != nil { // If a user creates a macvlan and ipvlan on same parent, only one slave iface can be active at a time. - return "", fmt.Errorf("failed to create the %s port: %v", macvlanType, err) + return "", fmt.Errorf("failed to create the macvlan port: %v", err) } return macvlan.Attrs().Name, nil @@ -170,7 +170,7 @@ func createDummyLink(dummyName, truncNetID string) error { } parentDummyLink, err := ns.NlHandle().LinkByName(dummyName) if err != nil { - return fmt.Errorf("error occurred looking up the %s parent iface %s error: %s", macvlanType, dummyName, err) + return fmt.Errorf("error occurred looking up the macvlan parent iface %s error: %s", dummyName, err) } // bring the new netlink iface up if err := ns.NlHandle().LinkSetUp(parentDummyLink); err != nil {