Skip to content

Commit 633dc8e

Browse files
committed
fix: addressing the comments
1 parent 859f4e4 commit 633dc8e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

network/network_windows.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,18 +365,19 @@ func (nm *networkManager) newNetworkImplHnsV2(nwInfo *EndpointInfo, extIf *exter
365365
} else {
366366
if strings.Contains(err.Error(), "already exists") {
367367
// fetch the network name again since the parallel CNI Add call has created the HNS network
368+
logger.Error("Failed to create hcn network.due to error:", zap.String("hnsResponse", hcnNetwork.Name), zap.String("hnsResponse", err.Error()))
368369
hnsResponse, err = Hnsv2.GetNetworkByName(hcnNetwork.Name)
369370
if err != nil {
370-
return nil, fmt.Errorf("Failed to get hcn network: %s due to error: %v", hcnNetwork.Name, err)
371+
return nil, fmt.Errorf("Failed to get hcn network: %s due to error %s", hcnNetwork.Name, err.Error())
371372
}
372-
logger.Info("Successfully fetched hcn network with response", zap.Any("hnsResponse", hnsResponse))
373+
logger.Info("Successfully fetched hcn network with response", zap.Any("hnsResponse", hnsResponse.Id))
373374
} else {
374-
return nil, fmt.Errorf("Failed to create hcn network: %s due to error: %v", hcnNetwork.Name, err)
375+
return nil, fmt.Errorf("Failed to create hcn network: %s due to error %s", hcnNetwork.Name, err.Error())
375376
}
376377
}
377378
} else {
378379
// we can't validate if the network already exists, don't continue
379-
return nil, fmt.Errorf("Failed to create hcn network: %s, failed to query for existing network with error: %v", hcnNetwork.Name, err)
380+
return nil, fmt.Errorf("Failed to create hcn network: %s due to error %s", hcnNetwork.Name, err.Error())
380381
}
381382
} else {
382383
if hcnNetwork.Type == hcn.Transparent {

0 commit comments

Comments
 (0)