From 43ce2eb1ff83558e522bfaffe2766c05543c4deb Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Thu, 30 Jan 2020 14:34:33 -0800 Subject: [PATCH] Ineffassign fixes for pkg/proxy --- pkg/proxy/winkernel/hnsV1.go | 3 +++ pkg/proxy/winkernel/hnsV2.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkg/proxy/winkernel/hnsV1.go b/pkg/proxy/winkernel/hnsV1.go index ed3545ea307..3787f4514ef 100644 --- a/pkg/proxy/winkernel/hnsV1.go +++ b/pkg/proxy/winkernel/hnsV1.go @@ -75,6 +75,9 @@ 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) + } for _, endpoint := range endpoints { equal := false if endpoint.IPAddress != nil { diff --git a/pkg/proxy/winkernel/hnsV2.go b/pkg/proxy/winkernel/hnsV2.go index fbfbecf2c4f..4898c2474f2 100644 --- a/pkg/proxy/winkernel/hnsV2.go +++ b/pkg/proxy/winkernel/hnsV2.go @@ -83,6 +83,9 @@ 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) + } for _, endpoint := range endpoints { equal := false if endpoint.IpConfigurations != nil && len(endpoint.IpConfigurations) > 0 {