From bfdffa1158d22de683748ea8d2c019dee2d715d9 Mon Sep 17 00:00:00 2001 From: kerthcet Date: Tue, 23 Jan 2024 16:53:06 +0800 Subject: [PATCH] fix lint Signed-off-by: kerthcet --- cmd/nvidia-dra-controller/allocations_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/nvidia-dra-controller/allocations_test.go b/cmd/nvidia-dra-controller/allocations_test.go index 106f48ce..c1f610fb 100644 --- a/cmd/nvidia-dra-controller/allocations_test.go +++ b/cmd/nvidia-dra-controller/allocations_test.go @@ -19,13 +19,13 @@ package main import ( "testing" - "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/gpu/nas/v1alpha1" + nascrd "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/gpu/nas/v1alpha1" "github.com/stretchr/testify/assert" ) func Test_PerNodeAllocatedClaims(t *testing.T) { allocationClaims := &PerNodeAllocatedClaims{ - allocations: make(map[string]map[string]v1alpha1.AllocatedDevices), + allocations: make(map[string]map[string]nascrd.AllocatedDevices), } // Test Exists() @@ -33,8 +33,8 @@ func Test_PerNodeAllocatedClaims(t *testing.T) { assert.Equal(t, false, exists) // Test Set() - device1 := v1alpha1.AllocatedDevices{ClaimInfo: &v1alpha1.ClaimInfo{Namespace: "default", Name: "device1"}} - device2 := v1alpha1.AllocatedDevices{ClaimInfo: &v1alpha1.ClaimInfo{Namespace: "default", Name: "device2"}} + device1 := nascrd.AllocatedDevices{ClaimInfo: &nascrd.ClaimInfo{Namespace: "default", Name: "device1"}} + device2 := nascrd.AllocatedDevices{ClaimInfo: &nascrd.ClaimInfo{Namespace: "default", Name: "device2"}} allocationClaims.Set("fake-claim", "fake-node", device1) allocationClaims.Set("fake-claim", "fake-node", device2) @@ -46,13 +46,13 @@ func Test_PerNodeAllocatedClaims(t *testing.T) { // Test Remove() allocationClaims.Remove("fake-claim") - assert.Equal(t, allocationClaims.allocations, map[string]map[string]v1alpha1.AllocatedDevices{}) + assert.Equal(t, allocationClaims.allocations, map[string]map[string]nascrd.AllocatedDevices{}) // Test RemoveNode() allocationClaims.Set("fake-claim", "fake-node-1", device1) allocationClaims.Set("fake-claim", "fake-node-2", device2) allocationClaims.RemoveNode("fake-claim", "fake-node-1") - assert.Equal(t, allocationClaims.allocations, map[string]map[string]v1alpha1.AllocatedDevices{"fake-claim": map[string]v1alpha1.AllocatedDevices{"fake-node-2": device2}}) + assert.Equal(t, allocationClaims.allocations, map[string]map[string]nascrd.AllocatedDevices{"fake-claim": map[string]nascrd.AllocatedDevices{"fake-node-2": device2}}) allocationClaims.RemoveNode("fake-claim", "fake-node-2") - assert.Equal(t, allocationClaims.allocations, map[string]map[string]v1alpha1.AllocatedDevices{}) + assert.Equal(t, allocationClaims.allocations, map[string]map[string]nascrd.AllocatedDevices{}) }