fix(win-bridge): panic while calling HNS api

Signed-off-by: thxcode <thxcode0824@gmail.com>
This commit is contained in:
thxcode 2021-02-26 10:45:29 +08:00
parent 47927f5084
commit 178d7c0934

View File

@ -112,10 +112,11 @@ func cmdHnsAdd(args *skel.CmdArgs, n *NetConf) (*current.Result, error) {
epName := hns.ConstructEndpointName(args.ContainerID, args.Netns, n.Name)
hnsEndpoint, err := hns.ProvisionEndpoint(epName, hnsNetwork.Id, args.ContainerID, args.Netns, func() (*hcsshim.HNSEndpoint, error) {
epInfo, err := ProcessEndpointArgs(args, n)
epInfo.NetworkId = hnsNetwork.Id
if err != nil {
return nil, errors.Annotatef(err, "error while ProcessEndpointArgs")
}
epInfo.NetworkId = hnsNetwork.Id
hnsEndpoint, err := hns.GenerateHnsEndpoint(epInfo, &n.NetConf)
if err != nil {
return nil, errors.Annotatef(err, "error while GenerateHnsEndpoint")