Skip to content

Commit a138a05

Browse files
authored
Merge pull request #383 from q384566678/linux-defer
validate: fix spec nil dereference
2 parents f49d861 + 5fa30f4 commit a138a05

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

validate/validate.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ func (v *Validator) CheckAll() (msgs []string) {
8989
msgs = append(msgs, v.CheckPlatform()...)
9090
msgs = append(msgs, v.CheckProcess()...)
9191
msgs = append(msgs, v.CheckOS()...)
92-
msgs = append(msgs, v.CheckLinux()...)
9392
msgs = append(msgs, v.CheckHooks()...)
93+
if v.spec.Linux != nil {
94+
msgs = append(msgs, v.CheckLinux()...)
95+
}
9496

9597
return
9698
}
@@ -259,7 +261,9 @@ func (v *Validator) CheckProcess() (msgs []string) {
259261
}
260262
}
261263

262-
msgs = append(msgs, v.CheckCapabilities()...)
264+
if v.spec.Process.Capabilities != nil {
265+
msgs = append(msgs, v.CheckCapabilities()...)
266+
}
263267
msgs = append(msgs, v.CheckRlimits()...)
264268

265269
if v.spec.Platform.OS == "linux" {

0 commit comments

Comments
 (0)