@@ -60,6 +60,11 @@ type options struct {
60
60
files cli.StringSlice
61
61
ignorePatterns cli.StringSlice
62
62
}
63
+
64
+ // spec represents the CDI spec options.
65
+ spec struct {
66
+ allowAdditionalGIDs bool
67
+ }
63
68
}
64
69
65
70
// NewCommand constructs a generate-cdi command with the specified logger
@@ -169,6 +174,11 @@ func (m command) build() *cli.Command {
169
174
Usage : "Specify a pattern the CSV mount specifications." ,
170
175
Destination : & opts .csv .ignorePatterns ,
171
176
},
177
+ & cli.BoolFlag {
178
+ Name : "--allow-additional-gids" ,
179
+ Usage : "Allow the use of the additionalGIDs field for generated CDI specifications. Note this will generate a v0.7.0 CDI specification." ,
180
+ Destination : & opts .spec .allowAdditionalGIDs ,
181
+ },
172
182
}
173
183
174
184
return & c
@@ -221,7 +231,7 @@ func (m command) validateFlags(c *cli.Context, opts *options) error {
221
231
return nil
222
232
}
223
233
224
- func (m command ) run (c * cli.Context , opts * options ) error {
234
+ func (m command ) run (_ * cli.Context , opts * options ) error {
225
235
spec , err := m .generateSpec (opts )
226
236
if err != nil {
227
237
return fmt .Errorf ("failed to generate CDI spec: %v" , err )
@@ -273,6 +283,7 @@ func (m command) generateSpec(opts *options) (spec.Interface, error) {
273
283
nvcdi .WithLibrarySearchPaths (opts .librarySearchPaths .Value ()),
274
284
nvcdi .WithCSVFiles (opts .csv .files .Value ()),
275
285
nvcdi .WithCSVIgnorePatterns (opts .csv .ignorePatterns .Value ()),
286
+ nvcdi .WithAllowAdditionalGIDs (opts .spec .allowAdditionalGIDs ),
276
287
)
277
288
if err != nil {
278
289
return nil , fmt .Errorf ("failed to create CDI library: %v" , err )
0 commit comments