Use device index as CDI device names by default

This change uses the `index` mode for the --device-name-strategy when
generating CDI specifications by default. This generates device names
such as nvidia.com/gpu=0 or nvidia.com/gpu=1:0 by default.

Note that this requires a CDI spec version of 0.5.0 and for consumers
(e.g. podman) that are only compatible with older versions one of the
other stragegies (`type-index` or `uuid`) should be used instead to
generate a v0.3.0 or v0.4.0 specification.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-01-30 13:36:11 +01:00
parent f0de3ccd9c
commit f768bb5783

View File

@ -89,8 +89,8 @@ func (m command) build() *cli.Command {
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "device-name-strategy", Name: "device-name-strategy",
Usage: "Specify the strategy for generating device names. One of [type-index | index | uuid]", Usage: "Specify the strategy for generating device names. One of [index | uuid | type-index]",
Value: deviceNameStrategyTypeIndex, Value: deviceNameStrategyIndex,
Destination: &cfg.deviceNameStrategy, Destination: &cfg.deviceNameStrategy,
}, },
&cli.StringFlag{ &cli.StringFlag{