mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-04-22 15:15:47 +00:00
[no-relnote] Fix ST1019: package tags.cncf.io/container-device-interface/specs-go is being imported more than once lint errors
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
be9d7b6db1
commit
80fb4dc0e9
@ -21,19 +21,18 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"tags.cncf.io/container-device-interface/pkg/parser"
|
"tags.cncf.io/container-device-interface/pkg/parser"
|
||||||
"tags.cncf.io/container-device-interface/specs-go"
|
|
||||||
cdi "tags.cncf.io/container-device-interface/specs-go"
|
cdi "tags.cncf.io/container-device-interface/specs-go"
|
||||||
|
|
||||||
"github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform"
|
"github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform"
|
||||||
)
|
)
|
||||||
|
|
||||||
type builder struct {
|
type builder struct {
|
||||||
raw *specs.Spec
|
raw *cdi.Spec
|
||||||
version string
|
version string
|
||||||
vendor string
|
vendor string
|
||||||
class string
|
class string
|
||||||
deviceSpecs []specs.Device
|
deviceSpecs []cdi.Device
|
||||||
edits specs.ContainerEdits
|
edits cdi.ContainerEdits
|
||||||
format string
|
format string
|
||||||
|
|
||||||
mergedDeviceOptions []transform.MergedDeviceOption
|
mergedDeviceOptions []transform.MergedDeviceOption
|
||||||
@ -86,7 +85,7 @@ func newBuilder(opts ...Option) *builder {
|
|||||||
func (o *builder) Build() (*spec, error) {
|
func (o *builder) Build() (*spec, error) {
|
||||||
raw := o.raw
|
raw := o.raw
|
||||||
if raw == nil {
|
if raw == nil {
|
||||||
raw = &specs.Spec{
|
raw = &cdi.Spec{
|
||||||
Version: o.version,
|
Version: o.version,
|
||||||
Kind: fmt.Sprintf("%s/%s", o.vendor, o.class),
|
Kind: fmt.Sprintf("%s/%s", o.vendor, o.class),
|
||||||
Devices: o.deviceSpecs,
|
Devices: o.deviceSpecs,
|
||||||
@ -127,14 +126,14 @@ func (o *builder) Build() (*spec, error) {
|
|||||||
type Option func(*builder)
|
type Option func(*builder)
|
||||||
|
|
||||||
// WithDeviceSpecs sets the device specs for the spec builder
|
// WithDeviceSpecs sets the device specs for the spec builder
|
||||||
func WithDeviceSpecs(deviceSpecs []specs.Device) Option {
|
func WithDeviceSpecs(deviceSpecs []cdi.Device) Option {
|
||||||
return func(o *builder) {
|
return func(o *builder) {
|
||||||
o.deviceSpecs = deviceSpecs
|
o.deviceSpecs = deviceSpecs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithEdits sets the container edits for the spec builder
|
// WithEdits sets the container edits for the spec builder
|
||||||
func WithEdits(edits specs.ContainerEdits) Option {
|
func WithEdits(edits cdi.ContainerEdits) Option {
|
||||||
return func(o *builder) {
|
return func(o *builder) {
|
||||||
o.edits = edits
|
o.edits = edits
|
||||||
}
|
}
|
||||||
@ -176,7 +175,7 @@ func WithNoSimplify(noSimplify bool) Option {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WithRawSpec sets the raw spec for the spec builder
|
// WithRawSpec sets the raw spec for the spec builder
|
||||||
func WithRawSpec(raw *specs.Spec) Option {
|
func WithRawSpec(raw *cdi.Spec) Option {
|
||||||
return func(o *builder) {
|
return func(o *builder) {
|
||||||
o.raw = raw
|
o.raw = raw
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user