NVIDIA / gpu-monitoring-tools

Tools for monitoring NVIDIA GPUs on Linux
Apache License 2.0
1.02k stars 301 forks source link

dcgm-exporter unit test depends on k8s.io/kubernetes directly as a library #172

Open shatil opened 3 years ago

shatil commented 3 years ago

As of tag 2.2.0, this test dependency in pkg:

% git grep k8s.io/kubernetes/pkg/kubelet/util
kubernetes_test.go:     "k8s.io/kubernetes/pkg/kubelet/util"

Breaks go mod:

% go mod why
go: finding module for package github.com/NVIDIA/gpu-monitoring-tools/bindings/go/nvml/nvsmi
go: finding module for package k8s.io/kubernetes/pkg/kubelet/apis/podresources/v1alpha1
go: finding module for package k8s.io/kubernetes/pkg/kubelet/util
go: found k8s.io/kubernetes/pkg/kubelet/util in k8s.io/kubernetes v1.20.5
go: found github.com/NVIDIA/gpu-monitoring-tools/bindings/go/nvml/nvsmi in github.com/NVIDIA/gpu-monitoring-tools v0.0.0-20210325210537-29b4f1784f18
go: k8s.io/kubernetes@v1.20.5 requires
    k8s.io/api@v0.0.0: reading k8s.io/api/go.mod at revision v0.0.0: unknown revision v0.0.0

We're not supposed to reference k8s.io/kubernetes directly: https://pkg.go.dev/k8s.io/kubernetes

To use Kubernetes code as a library in other applications, see the list of published components. Use of the k8s.io/kubernetes module or k8s.io/kubernetes/... packages as libraries is not supported.

Related: