cleanup: fix errors in wrapped format and log capitalization in proxy

Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
This commit is contained in:
wangyx1992
2021-04-21 11:28:39 +08:00
parent 657d93c4cc
commit c85e567a3d
9 changed files with 25 additions and 25 deletions

View File

@@ -81,7 +81,7 @@ func (hns hnsV1) getEndpointByIpAddress(ip string, networkName string) (*endpoin
endpoints, err := hcsshim.HNSListEndpointRequest()
if err != nil {
return nil, fmt.Errorf("Failed to list endpoints: %v", err)
return nil, fmt.Errorf("failed to list endpoints: %w", err)
}
for _, endpoint := range endpoints {
equal := false
@@ -137,7 +137,7 @@ func (hns hnsV1) createEndpoint(ep *endpointsInfo, networkName string) (*endpoin
} else {
createdEndpoint, err = hnsNetwork.CreateEndpoint(hnsEndpoint)
if err != nil {
return nil, fmt.Errorf("Local endpoint creation failed: %v", err)
return nil, fmt.Errorf("local endpoint creation failed: %w", err)
}
}
return &endpointsInfo{

View File

@@ -48,7 +48,7 @@ func (hns hnsV2) getNetworkByName(name string) (*hnsNetworkInfo, error) {
policySettings := hcn.RemoteSubnetRoutePolicySetting{}
err = json.Unmarshal(policy.Settings, &policySettings)
if err != nil {
return nil, fmt.Errorf("Failed to unmarshal Remote Subnet policy settings")
return nil, fmt.Errorf("failed to unmarshal Remote Subnet policy settings")
}
rs := &remoteSubnetInfo{
destinationPrefix: policySettings.DestinationPrefix,
@@ -89,7 +89,7 @@ func (hns hnsV2) getEndpointByIpAddress(ip string, networkName string) (*endpoin
endpoints, err := hcn.ListEndpoints()
if err != nil {
return nil, fmt.Errorf("Failed to list endpoints: %v", err)
return nil, fmt.Errorf("failed to list endpoints: %w", err)
}
for _, endpoint := range endpoints {
equal := false

View File

@@ -576,7 +576,7 @@ func NewProxier(
time.Sleep(10 * time.Second)
hnsNetworkInfo, err = hns.getNetworkByName(hnsNetworkName)
if err != nil {
return nil, fmt.Errorf("Could not find HNS network %s", hnsNetworkName)
return nil, fmt.Errorf("could not find HNS network %s", hnsNetworkName)
}
}
@@ -617,7 +617,7 @@ func NewProxier(
}
}
if len(hostMac) == 0 {
return nil, fmt.Errorf("Could not find host mac address for %s", nodeIP)
return nil, fmt.Errorf("could not find host mac address for %s", nodeIP)
}
}