Skip to content

Commit 15e66d7

Browse files
fix linting error
1 parent d37a407 commit 15e66d7

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

cns/restserver/internalapi.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ func (service *HTTPRestService) isNCDetailsAPIExists(ctx context.Context) bool {
692692
}
693693

694694
// GetIMDSNCs gets NC versions from IMDS and returns them as a map along with the MAC address
695-
func (service *HTTPRestService) getIMDSNCs(ctx context.Context) (map[string]string, string) {
695+
func (service *HTTPRestService) getIMDSNCs(ctx context.Context) (ncs map[string]string, infraNicMacAddress string) {
696696
imdsClient := service.imdsClient
697697
if imdsClient == nil {
698698
//nolint:staticcheck // SA1019: suppress deprecated logger.Printf usage. Todo: legacy logger usage is consistent in cns repo. Migrates when all logger usage is migrated
@@ -715,8 +715,7 @@ func (service *HTTPRestService) getIMDSNCs(ctx context.Context) (map[string]stri
715715
}
716716

717717
// Build ncs map from the network interfaces
718-
ncs := make(map[string]string)
719-
var infraNicMacAddress string
718+
ncs = make(map[string]string)
720719
for _, iface := range networkInterfaces {
721720
//nolint:staticcheck // SA1019: suppress deprecated logger.Debugf usage. Todo: legacy logger usage is consistent in cns repo. Migrates when all logger usage is migrated
722721
logger.Debugf("Nc id: %s and mac address: %s from IMDS call", iface.InterfaceCompartmentID, iface.MacAddress.String())

cns/restserver/internalapi_windows_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ import (
1616
type mockWindowsRegistryClient struct {
1717
// Store call history
1818
calls []registryCall
19-
20-
setPrefixOnNicEnabledError bool
21-
setInfraNicIfNameError bool
22-
setEnableSNATError bool
2319
}
2420

2521
type registryCall struct {
@@ -96,9 +92,7 @@ func TestProcessWindowsRegistryKeys_ValidMacAddress(t *testing.T) {
9692

9793
func TestProcessWindowsRegistryKeys_RegistryError(t *testing.T) {
9894
validMacAddress := "00:15:5D:01:02:03"
99-
mockRegistry := &mockWindowsRegistryClient{
100-
setPrefixOnNicEnabledError: true,
101-
}
95+
mockRegistry := &mockWindowsRegistryClient{}
10296
service := &HTTPRestService{
10397
windowsRegistry: mockRegistry,
10498
state: &httpRestServiceState{

0 commit comments

Comments
 (0)