mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
timens: minor cleanups
Fix up a few things that were flagged in the review of the original timens PR, namely around error handling and validation. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This commit is contained in:
@@ -120,6 +120,10 @@ func namespaces(config *configs.Config) error {
|
||||
if _, err := os.Stat("/proc/self/timens_offsets"); os.IsNotExist(err) {
|
||||
return errors.New("time namespaces aren't enabled in the kernel")
|
||||
}
|
||||
} else {
|
||||
if config.TimeOffsets != nil {
|
||||
return errors.New("time namespace offsets specified, but time namespace isn't enabled in the config")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user