Skip to content

Commit e6a9160

Browse files
authored
fix lints
Signed-off-by: GitHub <[email protected]>
1 parent ee5477b commit e6a9160

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

cns/NetworkContainerContract.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (f PodInfoByIPProviderFunc) PodInfoByIP() (map[string]PodInfo, error) {
201201
return f()
202202
}
203203

204-
var GlobalPodInfoScheme podInfoScheme = InterfaceIDPodInfoScheme
204+
var GlobalPodInfoScheme = InterfaceIDPodInfoScheme
205205

206206
// podInfoScheme indicates which schema should be used when generating
207207
// the map key in the Key() function on a podInfo object.
@@ -319,7 +319,7 @@ func (p *podInfo) UnmarshalJSON(b []byte) error {
319319
alias: (*alias)(p),
320320
}
321321
if err := json.Unmarshal(b, a); err != nil {
322-
return err
322+
return errors.Wrap(err, "failed to unmarshal podInfo")
323323
}
324324
p.Version = GlobalPodInfoScheme
325325
return nil

cns/restserver/ipam_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func newSecondaryIPConfig(ipAddress string, ncVersion int) cns.SecondaryIPConfig
9191
}
9292
}
9393

94-
func newPodState(ipaddress, id, ncid string, state types.IPState, ncVersion int) cns.IPConfigurationStatus {
94+
func newPodState(ipaddress, id, ncid string, state types.IPState, ncVersion int) cns.IPConfigurationStatus { //nolint:unparam // ignore unused parameter
9595
ipconfig := newSecondaryIPConfig(ipaddress, ncVersion)
9696
status := &cns.IPConfigurationStatus{
9797
IPAddress: ipconfig.IPAddress,
@@ -131,7 +131,8 @@ func requestIPAddressAndGetState(t *testing.T, req cns.IPConfigsRequest) ([]cns.
131131
return ipConfigStatus, nil
132132
}
133133

134-
func newPodStateWithOrchestratorContext(ipaddress, id, ncid string, state types.IPState, prefixLength uint8, ncVersion int, podInfo cns.PodInfo) (cns.IPConfigurationStatus, error) {
134+
// nolint:unparam // ignore unused inputs
135+
func newPodStateWithOrchestratorContext(ipaddress, id, ncid string, state types.IPState, _ uint8, ncVersion int, podInfo cns.PodInfo) (cns.IPConfigurationStatus, error) {
135136
ipconfig := newSecondaryIPConfig(ipaddress, ncVersion)
136137
status := &cns.IPConfigurationStatus{
137138
IPAddress: ipconfig.IPAddress,
@@ -144,6 +145,7 @@ func newPodStateWithOrchestratorContext(ipaddress, id, ncid string, state types.
144145
}
145146

146147
// Test function to populate the IPConfigState
148+
// nolint: unparam // ignore unused return
147149
func updatePodIPConfigState(t *testing.T, svc *HTTPRestService, ipconfigs map[string]cns.IPConfigurationStatus, ncID string) error {
148150
// Create the NC
149151
secondaryIPConfigs := make(map[string]cns.SecondaryIPConfig)

cns/restserver/nodesubnet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"testing"
77

88
"github.com/Azure/azure-container-networking/cns/logger"
9-
"github.com/Azure/azure-container-networking/cns/stateprovider/cns"
109
"github.com/Azure/azure-container-networking/cns/restserver"
10+
"github.com/Azure/azure-container-networking/cns/stateprovider/cns"
1111
"github.com/Azure/azure-container-networking/cns/types"
1212
"github.com/Azure/azure-container-networking/store"
1313
)

cns/stateprovider/cns/podinfoprovider_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ func TestNewCNSPodInfoProvider(t *testing.T) {
4444
}
4545

4646
for _, tt := range tests {
47-
tt := tt
4847
t.Run(tt.name, func(t *testing.T) {
4948
got, err := podInfoProvider(tt.store)
5049
if tt.wantErr {

0 commit comments

Comments
 (0)