Skip to content

Commit

Permalink
the linter...
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Zappa <[email protected]>
  • Loading branch information
MikeZappa87 committed Apr 5, 2024
1 parent 409e269 commit 093b47e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
timeout-minutes: 5

steps:
- uses: actions/setup-go@v5
- uses: actions/setup-go@v3
with:
go-version: 1.21.x
go-version: 1.20.x

- name: Set env
shell: bash
Expand Down Expand Up @@ -44,15 +44,15 @@ jobs:

strategy:
matrix:
go-version: [1.22.x, 1.21.x]
go-version: [1.19.x, 1.20.x]
os: [ubuntu-22.04]

steps:
- uses: actions/checkout@v3
with:
path: src/github.com/containerd/go-cni

- uses: actions/setup-go@v5
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

Expand All @@ -64,7 +64,7 @@ jobs:
- uses: golangci/golangci-lint-action@v3
with:
version: v1.51.1
version: v1.57.2
working-directory: src/github.com/containerd/go-cni

tests:
Expand All @@ -74,14 +74,14 @@ jobs:

strategy:
matrix:
go-version: [1.22.x, 1.21.x]
go-version: [1.19.x, 1.20.x]

steps:
- uses: actions/checkout@v3
with:
path: src/github.com/containerd/go-cni

- uses: actions/setup-go@v5
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

Expand Down
4 changes: 2 additions & 2 deletions cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ func (c *libcni) Status() error {
}

for _, dir := range c.pluginDirs {
for _, nets := range c.networks {
for _, nets := range c.networks {
for _, plug := range nets.config.Plugins {
plugin := plug.Network.Type

if !FileExistsInDir(dir, plugin) {
return ErrCNIPluginNotFound
}
}
}
}
}

return nil
Expand Down
37 changes: 18 additions & 19 deletions cni_test.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/*
Copyright The containerd Authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cni

import (
Expand Down Expand Up @@ -289,32 +288,32 @@ type MockCNI struct {
mock.Mock
}

func (m *MockCNI) AddNetwork(ctx context.Context, net *cnilibrary.NetworkConfig, rt *cnilibrary.RuntimeConf) (types.Result, error) {
func (m *MockCNI) AddNetwork(_ context.Context, net *cnilibrary.NetworkConfig, rt *cnilibrary.RuntimeConf) (types.Result, error) {
args := m.Called(net, rt)
return args.Get(0).(types.Result), args.Error(1)
}

func (m *MockCNI) DelNetwork(ctx context.Context, net *cnilibrary.NetworkConfig, rt *cnilibrary.RuntimeConf) error {
func (m *MockCNI) DelNetwork(_ context.Context, net *cnilibrary.NetworkConfig, rt *cnilibrary.RuntimeConf) error {
args := m.Called(net, rt)
return args.Error(0)
}

func (m *MockCNI) DelNetworkList(ctx context.Context, net *cnilibrary.NetworkConfigList, rt *cnilibrary.RuntimeConf) error {
func (m *MockCNI) DelNetworkList(_ context.Context, net *cnilibrary.NetworkConfigList, rt *cnilibrary.RuntimeConf) error {
args := m.Called(net, rt)
return args.Error(0)
}

func (m *MockCNI) AddNetworkList(ctx context.Context, net *cnilibrary.NetworkConfigList, rt *cnilibrary.RuntimeConf) (types.Result, error) {
func (m *MockCNI) AddNetworkList(_ context.Context, net *cnilibrary.NetworkConfigList, rt *cnilibrary.RuntimeConf) (types.Result, error) {
args := m.Called(net, rt)
return args.Get(0).(types.Result), args.Error(1)
}

func (m *MockCNI) CheckNetworkList(ctx context.Context, net *cnilibrary.NetworkConfigList, rt *cnilibrary.RuntimeConf) error {
func (m *MockCNI) CheckNetworkList(_ context.Context, net *cnilibrary.NetworkConfigList, rt *cnilibrary.RuntimeConf) error {
args := m.Called(net, rt)
return args.Error(0)
}

func (m *MockCNI) CheckNetwork(ctx context.Context, net *cnilibrary.NetworkConfig, rt *cnilibrary.RuntimeConf) error {
func (m *MockCNI) CheckNetwork(_ context.Context, net *cnilibrary.NetworkConfig, rt *cnilibrary.RuntimeConf) error {
args := m.Called(net, rt)
return args.Error(0)
}
Expand All @@ -329,12 +328,12 @@ func (m *MockCNI) GetNetworkCachedResult(net *cnilibrary.NetworkConfig, rt *cnil
return args.Get(0).(types.Result), args.Error(1)
}

func (m *MockCNI) ValidateNetworkList(ctx context.Context, net *cnilibrary.NetworkConfigList) ([]string, error) {
func (m *MockCNI) ValidateNetworkList(_ context.Context, net *cnilibrary.NetworkConfigList) ([]string, error) {
args := m.Called(net)
return args.Get(0).([]string), args.Error(1)
}

func (m *MockCNI) ValidateNetwork(ctx context.Context, net *cnilibrary.NetworkConfig) ([]string, error) {
func (m *MockCNI) ValidateNetwork(_ context.Context, net *cnilibrary.NetworkConfig) ([]string, error) {
args := m.Called(net)
return args.Get(0).([]string), args.Error(1)
}
Expand Down

0 comments on commit 093b47e

Please sign in to comment.