mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
Merge pull request #13 from bart0sh/PR0006-reformat-with-gofmt-s
reformatted *.go with gofmt -s -w
This commit is contained in:
commit
c3d89a7a4b
@ -116,22 +116,22 @@ func TestDiscoverFPGAs(t *testing.T) {
|
|||||||
"intel-fpga-port.2", "intel-fpga-fme.2",
|
"intel-fpga-port.2", "intel-fpga-fme.2",
|
||||||
},
|
},
|
||||||
expectedResult: map[string]map[string]deviceplugin.DeviceInfo{
|
expectedResult: map[string]map[string]deviceplugin.DeviceInfo{
|
||||||
fmt.Sprintf("%s-d8424dc4a4a3c413f89e433683f9040b", afMode): map[string]deviceplugin.DeviceInfo{
|
fmt.Sprintf("%s-d8424dc4a4a3c413f89e433683f9040b", afMode): {
|
||||||
"intel-fpga-dev.0": deviceplugin.DeviceInfo{
|
"intel-fpga-dev.0": {
|
||||||
State: "Healthy",
|
State: "Healthy",
|
||||||
Nodes: []string{
|
Nodes: []string{
|
||||||
path.Join(tmpdir, "/dev/intel-fpga-port.0"),
|
path.Join(tmpdir, "/dev/intel-fpga-port.0"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"intel-fpga-dev.1": deviceplugin.DeviceInfo{
|
"intel-fpga-dev.1": {
|
||||||
State: "Healthy",
|
State: "Healthy",
|
||||||
Nodes: []string{
|
Nodes: []string{
|
||||||
path.Join(tmpdir, "/dev/intel-fpga-port.1"),
|
path.Join(tmpdir, "/dev/intel-fpga-port.1"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
fmt.Sprintf("%s-47595d0fae972fbed0c51b4a41c7a349", afMode): map[string]deviceplugin.DeviceInfo{
|
fmt.Sprintf("%s-47595d0fae972fbed0c51b4a41c7a349", afMode): {
|
||||||
"intel-fpga-dev.2": deviceplugin.DeviceInfo{
|
"intel-fpga-dev.2": {
|
||||||
State: "Healthy",
|
State: "Healthy",
|
||||||
Nodes: []string{
|
Nodes: []string{
|
||||||
path.Join(tmpdir, "/dev/intel-fpga-port.2"),
|
path.Join(tmpdir, "/dev/intel-fpga-port.2"),
|
||||||
@ -187,15 +187,15 @@ func TestDiscoverFPGAs(t *testing.T) {
|
|||||||
"intel-fpga-port.2", "intel-fpga-fme.2",
|
"intel-fpga-port.2", "intel-fpga-fme.2",
|
||||||
},
|
},
|
||||||
expectedResult: map[string]map[string]deviceplugin.DeviceInfo{
|
expectedResult: map[string]map[string]deviceplugin.DeviceInfo{
|
||||||
fmt.Sprintf("%s-ce48969398f05f33946d560708be108a", regionMode): map[string]deviceplugin.DeviceInfo{
|
fmt.Sprintf("%s-ce48969398f05f33946d560708be108a", regionMode): {
|
||||||
"intel-fpga-dev.0": deviceplugin.DeviceInfo{
|
"intel-fpga-dev.0": {
|
||||||
State: "Healthy",
|
State: "Healthy",
|
||||||
Nodes: []string{
|
Nodes: []string{
|
||||||
path.Join(tmpdir, "/dev/intel-fpga-fme.0"),
|
path.Join(tmpdir, "/dev/intel-fpga-fme.0"),
|
||||||
path.Join(tmpdir, "/dev/intel-fpga-port.0"),
|
path.Join(tmpdir, "/dev/intel-fpga-port.0"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"intel-fpga-dev.1": deviceplugin.DeviceInfo{
|
"intel-fpga-dev.1": {
|
||||||
State: "Healthy",
|
State: "Healthy",
|
||||||
Nodes: []string{
|
Nodes: []string{
|
||||||
path.Join(tmpdir, "/dev/intel-fpga-fme.1"),
|
path.Join(tmpdir, "/dev/intel-fpga-fme.1"),
|
||||||
@ -203,8 +203,8 @@ func TestDiscoverFPGAs(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
fmt.Sprintf("%s-fd967345645f05f338462a0748be0091", regionMode): map[string]deviceplugin.DeviceInfo{
|
fmt.Sprintf("%s-fd967345645f05f338462a0748be0091", regionMode): {
|
||||||
"intel-fpga-dev.2": deviceplugin.DeviceInfo{
|
"intel-fpga-dev.2": {
|
||||||
State: "Healthy",
|
State: "Healthy",
|
||||||
Nodes: []string{
|
Nodes: []string{
|
||||||
path.Join(tmpdir, "/dev/intel-fpga-fme.2"),
|
path.Join(tmpdir, "/dev/intel-fpga-fme.2"),
|
||||||
@ -329,8 +329,8 @@ func TestListAndWatch(t *testing.T) {
|
|||||||
"intel-fpga-port.2", "intel-fpga-fme.2",
|
"intel-fpga-port.2", "intel-fpga-fme.2",
|
||||||
},
|
},
|
||||||
expectedResult: []*pluginapi.Device{
|
expectedResult: []*pluginapi.Device{
|
||||||
&pluginapi.Device{"intel-fpga-dev.0", "Healthy"},
|
{"intel-fpga-dev.0", "Healthy"},
|
||||||
&pluginapi.Device{"intel-fpga-dev.1", "Healthy"},
|
{"intel-fpga-dev.1", "Healthy"},
|
||||||
},
|
},
|
||||||
expectedErr: false,
|
expectedErr: false,
|
||||||
},
|
},
|
||||||
@ -393,7 +393,7 @@ func TestAllocate(t *testing.T) {
|
|||||||
|
|
||||||
rqt := &pluginapi.AllocateRequest{
|
rqt := &pluginapi.AllocateRequest{
|
||||||
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
||||||
&pluginapi.ContainerAllocateRequest{
|
{
|
||||||
DevicesIDs: []string{"dev1"},
|
DevicesIDs: []string{"dev1"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -101,7 +101,7 @@ func TestAllocate(t *testing.T) {
|
|||||||
|
|
||||||
rqt := &pluginapi.AllocateRequest{
|
rqt := &pluginapi.AllocateRequest{
|
||||||
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
||||||
&pluginapi.ContainerAllocateRequest{
|
{
|
||||||
DevicesIDs: []string{"dev1"},
|
DevicesIDs: []string{"dev1"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -163,7 +163,7 @@ func TestSetupAndServe(t *testing.T) {
|
|||||||
client := pluginapi.NewDevicePluginClient(conn)
|
client := pluginapi.NewDevicePluginClient(conn)
|
||||||
_, err = client.Allocate(context.Background(), &pluginapi.AllocateRequest{
|
_, err = client.Allocate(context.Background(), &pluginapi.AllocateRequest{
|
||||||
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
||||||
&pluginapi.ContainerAllocateRequest{
|
{
|
||||||
DevicesIDs: []string{"dev1", "dev2"},
|
DevicesIDs: []string{"dev1", "dev2"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -205,7 +205,7 @@ func TestSetupAndServe(t *testing.T) {
|
|||||||
client = pluginapi.NewDevicePluginClient(conn)
|
client = pluginapi.NewDevicePluginClient(conn)
|
||||||
_, err = client.Allocate(context.Background(), &pluginapi.AllocateRequest{
|
_, err = client.Allocate(context.Background(), &pluginapi.AllocateRequest{
|
||||||
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
||||||
&pluginapi.ContainerAllocateRequest{
|
{
|
||||||
DevicesIDs: []string{"dev1", "dev2"},
|
DevicesIDs: []string{"dev1", "dev2"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -226,7 +226,7 @@ func TestStop(t *testing.T) {
|
|||||||
func TestMakeAllocateResponse(t *testing.T) {
|
func TestMakeAllocateResponse(t *testing.T) {
|
||||||
rqt := &pluginapi.AllocateRequest{
|
rqt := &pluginapi.AllocateRequest{
|
||||||
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
|
||||||
&pluginapi.ContainerAllocateRequest{
|
{
|
||||||
DevicesIDs: []string{"dev1"},
|
DevicesIDs: []string{"dev1"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -238,7 +238,7 @@ func TestMakeAllocateResponse(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
devices := map[string]DeviceInfo{
|
devices := map[string]DeviceInfo{
|
||||||
"dev1": DeviceInfo{pluginapi.Unhealthy, []string{"/dev/dev1"}},
|
"dev1": {pluginapi.Unhealthy, []string{"/dev/dev1"}},
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = MakeAllocateResponse(rqt, devices)
|
_, err = MakeAllocateResponse(rqt, devices)
|
||||||
|
Loading…
Reference in New Issue
Block a user