volcano icon indicating copy to clipboard operation
volcano copied to clipboard

Fix device share plugins npe

Open coldzerofear opened this issue 2 years ago • 7 comments

There is an NPE issue with the device share plugin, #3241 Not really solving the problem

unit testing

func TestDevices(t *testing.T) {
	others := make(map[string]interface{})
	nodeDevices := vgpu.DecodeNodeDevices("k8s01", "GPU-c496852d-f5df-316c-e2d5-86f0b322ec4c,20,30720,100,NVIDIA-NVIDIA GeForce RTX 3080 Ti,0,false:")
	others["gpu1"] = nodeDevices
	var dev2 *vgpu.GPUDevices = nil
	others["gpu2"] = dev2
	var dev3 Devices = nil
	others["gpu3"] = dev3
	var dev4 Devices = dev2
	others["gpu4"] = dev4
	for key, val := range others {
		if dev, ok := val.(Devices); ok {
			if dev == nil {
				fmt.Println(key, "is nil")
				continue
			}
			fmt.Println(key, "is not nil")
		} else {
			fmt.Println(key, "is not devices")
		}
	}
}

Output results

=== RUN   TestDevices
gpu1 is not nil
gpu2 is not nil
gpu3 is not devices
gpu4 is not nil
--- PASS: TestDevices (0.00s)

This does not meet expectations

coldzerofear avatar Mar 15 '24 03:03 coldzerofear

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign k82cn You can assign the PR to them by writing /assign @k82cn in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

volcano-sh-bot avatar Mar 15 '24 03:03 volcano-sh-bot

/assign @k82cn

coldzerofear avatar Mar 15 '24 03:03 coldzerofear

/ok-to-test

lowang-bh avatar Mar 31 '24 08:03 lowang-bh

please squash commits to one commit.

lowang-bh avatar Apr 01 '24 03:04 lowang-bh

Hi, please sign off your commit with git commit -s

Monokaix avatar May 08 '24 03:05 Monokaix

@coldzerofear: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

volcano-sh-bot avatar May 09 '24 06:05 volcano-sh-bot

Hi,please make ci happy, it's a serious bug and is urgent because we will release new version soon, if you're not availiable we can cherry-pick your commit and submit a new pr: )

Monokaix avatar May 15 '24 09:05 Monokaix