From 5a78120e24b7de4366a5d620bd7606d5e39f03f6 Mon Sep 17 00:00:00 2001 From: Nathan Gieseker Date: Thu, 2 May 2019 19:54:39 -0700 Subject: [PATCH] Windows: case insensitive compare for ids --- pkg/hns/endpoint_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/hns/endpoint_windows.go b/pkg/hns/endpoint_windows.go index 33a3d89e..85a0f64e 100644 --- a/pkg/hns/endpoint_windows.go +++ b/pkg/hns/endpoint_windows.go @@ -102,7 +102,7 @@ func GenerateHcnEndpoint(epInfo *EndpointInfo, n *NetConf) (*hcn.HostComputeEndp // If the endpont already exists, then we should return error unless // the endpoint is based on a different network then delete // should that fail return error - if hcnEndpoint.HostComputeNetwork != epInfo.NetworkId { + if !strings.EqualFold(hcnEndpoint.HostComputeNetwork, epInfo.NetworkId) { err = hcnEndpoint.Delete() if err != nil { return nil, errors.Annotatef(err, "Failed to delete endpoint %v", epInfo.EndpointName) @@ -212,7 +212,7 @@ func ProvisionEndpoint(epName string, expectedNetworkId string, containerID stri // check if endpoint already exists createEndpoint := true hnsEndpoint, err := hcsshim.GetHNSEndpointByName(epName) - if hnsEndpoint != nil && hnsEndpoint.VirtualNetwork == expectedNetworkId { + if hnsEndpoint != nil && strings.EqualFold(hnsEndpoint.VirtualNetwork, expectedNetworkId) { createEndpoint = false }