Windows: case insensitive compare for ids
This commit is contained in:
parent
44297f6ba3
commit
5a78120e24
@ -102,7 +102,7 @@ func GenerateHcnEndpoint(epInfo *EndpointInfo, n *NetConf) (*hcn.HostComputeEndp
|
|||||||
// If the endpont already exists, then we should return error unless
|
// If the endpont already exists, then we should return error unless
|
||||||
// the endpoint is based on a different network then delete
|
// the endpoint is based on a different network then delete
|
||||||
// should that fail return error
|
// should that fail return error
|
||||||
if hcnEndpoint.HostComputeNetwork != epInfo.NetworkId {
|
if !strings.EqualFold(hcnEndpoint.HostComputeNetwork, epInfo.NetworkId) {
|
||||||
err = hcnEndpoint.Delete()
|
err = hcnEndpoint.Delete()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Annotatef(err, "Failed to delete endpoint %v", epInfo.EndpointName)
|
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
|
// check if endpoint already exists
|
||||||
createEndpoint := true
|
createEndpoint := true
|
||||||
hnsEndpoint, err := hcsshim.GetHNSEndpointByName(epName)
|
hnsEndpoint, err := hcsshim.GetHNSEndpointByName(epName)
|
||||||
if hnsEndpoint != nil && hnsEndpoint.VirtualNetwork == expectedNetworkId {
|
if hnsEndpoint != nil && strings.EqualFold(hnsEndpoint.VirtualNetwork, expectedNetworkId) {
|
||||||
createEndpoint = false
|
createEndpoint = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user