@@ -60,6 +60,11 @@ type options struct {
6060 files cli.StringSlice
6161 ignorePatterns cli.StringSlice
6262 }
63+
64+ // spec represents the CDI spec options.
65+ spec struct {
66+ allowAdditionalGIDs bool
67+ }
6368}
6469
6570// NewCommand constructs a generate-cdi command with the specified logger
@@ -169,6 +174,11 @@ func (m command) build() *cli.Command {
169174 Usage : "Specify a pattern the CSV mount specifications." ,
170175 Destination : & opts .csv .ignorePatterns ,
171176 },
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+ },
172182 }
173183
174184 return & c
@@ -221,7 +231,7 @@ func (m command) validateFlags(c *cli.Context, opts *options) error {
221231 return nil
222232}
223233
224- func (m command ) run (c * cli.Context , opts * options ) error {
234+ func (m command ) run (_ * cli.Context , opts * options ) error {
225235 spec , err := m .generateSpec (opts )
226236 if err != nil {
227237 return fmt .Errorf ("failed to generate CDI spec: %v" , err )
@@ -273,6 +283,7 @@ func (m command) generateSpec(opts *options) (spec.Interface, error) {
273283 nvcdi .WithLibrarySearchPaths (opts .librarySearchPaths .Value ()),
274284 nvcdi .WithCSVFiles (opts .csv .files .Value ()),
275285 nvcdi .WithCSVIgnorePatterns (opts .csv .ignorePatterns .Value ()),
286+ nvcdi .WithAllowAdditionalGIDs (opts .spec .allowAdditionalGIDs ),
276287 )
277288 if err != nil {
278289 return nil , fmt .Errorf ("failed to create CDI library: %v" , err )
0 commit comments