Skip to content

Commit 2a0888b

Browse files
committed
Merge branch 'CNT-1028/raise-error-for-misconfigured-mig-devices' into 'master'
Raise an error if a device has migEnabled=true but has no MIG devices See merge request nvidia/kubernetes/device-plugin!71
2 parents f8b50cc + 013af89 commit 2a0888b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mig-strategy.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,11 @@ func (s *migStrategySingle) MatchesResource(mig *nvml.Device, resource string) b
167167
func (s *migStrategyMixed) GetPlugins() []*NvidiaDevicePlugin {
168168
devices := NewMIGCapableDevices()
169169

170-
resources := make(MigStrategyResourceSet)
170+
if err := devices.AssertAllMigEnabledDevicesAreValid(); err != nil {
171+
panic(fmt.Errorf("At least one device with migEnabled=true was not configured corectly: %v", err))
172+
}
171173

174+
resources := make(MigStrategyResourceSet)
172175
migs, err := devices.GetAllMigDevices()
173176
if err != nil {
174177
panic(fmt.Errorf("Unable to retrieve list of MIG devices: %v", err))

0 commit comments

Comments
 (0)