-
Notifications
You must be signed in to change notification settings - Fork 94
Closed as not planned
Description
Importing API types causes a panic.
Repro steps:
$ mkdir test-dra-import
$ cd test-dra-import/
$ go mod init github.com/my/test
go: creating new go.mod: module github.com/my/test
$ go get github.com/NVIDIA/k8s-dra-driver-gpu@latest
$ cat <<EOF > main.go
package main
import (
"github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)
func main() {
_ = v1beta1.ComputeDomain{}
}
EOF
$ go mod tidy
$ go run ./main.go
panic: could not parse "unknown" as version
goroutine 1 [running]:
k8s.io/apimachinery/pkg/util/version.MustParse(...)
/home/estroz/go/pkg/mod/k8s.io/[email protected]/pkg/util/version/version.go:164
github.com/NVIDIA/k8s-dra-driver-gpu/pkg/featuregates.parseProjectVersion()
/home/estroz/go/pkg/mod/github.com/!n!v!i!d!i!a/[email protected]/pkg/featuregates/featuregates.go:79 +0x1c5
github.com/NVIDIA/k8s-dra-driver-gpu/pkg/featuregates.init.0()
/home/estroz/go/pkg/mod/github.com/!n!v!i!d!i!a/[email protected]/pkg/featuregates/featuregates.go:73 +0x13
exit status 2This can be worked around in builds by setting variables in ldflags but not in tests
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Closed