volcano-sh / volcano

A Cloud Native Batch System (Project under CNCF)
https://volcano.sh
Apache License 2.0
4.13k stars 953 forks source link

We'd better not depend on a kubeconfig file #3473

Open lowang-bh opened 4 months ago

lowang-bh commented 4 months ago

https://github.com/VasuDevrani/volcano/actions/runs/9105698087/job/25031701446?pr=1

E0516 02:53:19.986663   39759 utils.go:43] init kubeclient in 4pdvgpu failed: stat /home/runner/.kube/config: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x16d78bd]

goroutine 1 [running]:
volcano.sh/apis/pkg/client/clientset/versioned.NewForConfig(0x0?)
    /home/runner/go/pkg/mod/volcano.sh/apis@v1.9.0/pkg/client/clientset/versioned/clientset.go:92 +0x1d
volcano.sh/apis/pkg/client/clientset/versioned.NewForConfigOrDie(...)
    /home/runner/go/pkg/mod/volcano.sh/apis@v1.9.0/pkg/client/clientset/versioned/clientset.go:153
volcano.sh/volcano/test/e2e/jobp.TestMain(0x1c51e00?)
    /home/runner/work/volcano/volcano/test/e2e/jobp/main_test.go:35 +0x67
main.main()
    _testmain.go:83 +0x1e6
FAIL    volcano.sh/volcano/test/e2e/jobp    0.023s
E0516 02:53:19.986155   39760 utils.go:43] init kubeclient in 4pdvgpu failed: stat /home/runner/.kube/config: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference

code at https://github.com/volcano-sh/volcano/blob/63bf2715100b1b62405e460df828df09eec9f4fe/pkg/scheduler/api/devices/nvidia/vgpu/utils.go#L39-L65

What would you like to be added:

The scheduler has its own service account. We'd better not to depend on a config file.

Why is this needed:

more compatible and portability

lowang-bh commented 4 months ago

@Monokaix @archlitchi

Monokaix commented 4 months ago

When will this ut failed?