mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add nvidia-ctk cdi transform root command
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
committed by
Christopher Desiniotis
parent
7f5c9abc1e
commit
6a83e2ebe5
@@ -41,6 +41,13 @@ func newBuilder(opts ...Option) *builder {
|
||||
for _, opt := range opts {
|
||||
opt(s)
|
||||
}
|
||||
if s.raw != nil {
|
||||
s.noSimplify = true
|
||||
vendor, class := cdi.ParseQualifier(s.raw.Kind)
|
||||
s.vendor = vendor
|
||||
s.class = class
|
||||
}
|
||||
|
||||
if s.version == "" {
|
||||
s.version = DetectMinimumVersion
|
||||
}
|
||||
@@ -60,7 +67,6 @@ func newBuilder(opts ...Option) *builder {
|
||||
// Build builds a CDI spec form the spec builder.
|
||||
func (o *builder) Build() (*spec, error) {
|
||||
raw := o.raw
|
||||
|
||||
if raw == nil {
|
||||
raw = &specs.Spec{
|
||||
Version: o.version,
|
||||
@@ -144,3 +150,10 @@ func WithNoSimplify(noSimplify bool) Option {
|
||||
o.noSimplify = noSimplify
|
||||
}
|
||||
}
|
||||
|
||||
// WithRawSpec sets the raw spec for the spec builder
|
||||
func WithRawSpec(raw *specs.Spec) Option {
|
||||
return func(o *builder) {
|
||||
o.raw = raw
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user