Skip to content

Commit

Permalink
Merge pull request #6410 from haircommander/fix-segfault
Browse files Browse the repository at this point in the history
specgen: fix segfault
  • Loading branch information
openshift-merge-robot authored May 27, 2020
2 parents c64abd0 + 339ffd8 commit adca437
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/specgen/generate/config_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,17 @@ func addPrivilegedDevices(g *generate.Generator) error {
newMounts = append(newMounts, devMnt)
}
g.Config.Mounts = append(newMounts, g.Config.Mounts...)
g.Config.Linux.Resources.Devices = nil
if g.Config.Linux.Resources != nil {
g.Config.Linux.Resources.Devices = nil
}
} else {
for _, d := range hostDevices {
g.AddDevice(Device(d))
}
// Add resources device - need to clear the existing one first.
g.Config.Linux.Resources.Devices = nil
if g.Config.Linux.Resources != nil {
g.Config.Linux.Resources.Devices = nil
}
g.AddLinuxResourcesDevice(true, "", nil, nil, "rwm")
}

Expand Down

0 comments on commit adca437

Please sign in to comment.