Skip to content

Commit

Permalink
Fix go lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
isaac-dasan authored Aug 22, 2024
1 parent 97d1e60 commit a463968
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions crd/swiftv2/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (m *mockClient) Patch(ctx context.Context, obj client.Object, patch client.
func TestCreateNodeInfo(t *testing.T) {
cli := multitenancy.NodeInfoClient{
Cli: &mockClient{
createFunc: func(ctx context.Context, obj client.Object, opts ...client.CreateOption) error {
createFunc: func(_ context.Context, _ client.Object, _ ...client.CreateOption) error {
return nil
},
},
Expand All @@ -49,10 +49,10 @@ func TestCreateNodeInfo(t *testing.T) {
func TestUpdateNodeInfo(t *testing.T) {
cli := multitenancy.NodeInfoClient{
Cli: &mockClient{
createFunc: func(ctx context.Context, obj client.Object, opts ...client.CreateOption) error {
createFunc: func(_ context.Context, obj client.Object, _ ...client.CreateOption) error {
return apierrors.NewAlreadyExists(schema.GroupResource{}, obj.GetName())
},
patchFunc: func(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error {
patchFunc: func(_ context.Context, _ client.Object, _ client.Patch, _ ...client.PatchOption) error {
return nil
},
},
Expand All @@ -71,7 +71,7 @@ func TestCreateNodeInfoInternalServerError(t *testing.T) {
someInternalError := errors.New("some internal error") //nolint:goerr113 // dynamic error is fine here
cli := multitenancy.NodeInfoClient{
Cli: &mockClient{
createFunc: func(ctx context.Context, obj client.Object, opts ...client.CreateOption) error {
createFunc: func(_ context.Context, _ client.Object, _ ...client.CreateOption) error {
return apierrors.NewInternalError(someInternalError)
},
},
Expand All @@ -93,10 +93,10 @@ func TestPatchNodeInfoInternalServerError(t *testing.T) {
someInternalError := errors.New("some internal error") //nolint:goerr113 // dynamic error is fine here
cli := multitenancy.NodeInfoClient{
Cli: &mockClient{
createFunc: func(ctx context.Context, obj client.Object, opts ...client.CreateOption) error {
createFunc: func(_ context.Context, obj client.Object, _ ...client.CreateOption) error {
return apierrors.NewAlreadyExists(schema.GroupResource{}, obj.GetName())
},
patchFunc: func(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error {
patchFunc: func(_ context.Context, _ client.Object, _ client.Patch, _ ...client.PatchOption) error {
return apierrors.NewInternalError(someInternalError)
},
},
Expand Down
9 changes: 5 additions & 4 deletions crd/swiftv2/embed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,31 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

const podNetworkFilename = "manifests/acn.azure.com_podnetworks.yaml"

func TestEmbedPodNetwork(t *testing.T) {
b, err := os.ReadFile(podNetworkFilename)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, b, PodNetworkYAML)
}

func TestGetPodNetworks(t *testing.T) {
_, err := GetPodNetworks()
assert.NoError(t, err)
require.NoError(t, err)
}

const workloadNetworkConfigFilename = "manifests/acn.azure.com_workloadnetworkconfigs.yaml"

func TestEmbedWorkloadNetworkConfig(t *testing.T) {
b, err := os.ReadFile(workloadNetworkConfigFilename)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, b, WorkloadNetworkConfigYAML)
}

func TestGetWorkloadNetworkConfigs(t *testing.T) {
_, err := GetWorkloadNetworkConfigs()
assert.NoError(t, err)
require.NoError(t, err)
}

0 comments on commit a463968

Please sign in to comment.