File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ func (v *Validator) CheckAll() (msgs []string) {
9898 msgs = append (msgs , v .CheckMounts ()... )
9999 msgs = append (msgs , v .CheckPlatform ()... )
100100 msgs = append (msgs , v .CheckProcess ()... )
101+ msgs = append (msgs , v .CheckOS ()... )
101102 msgs = append (msgs , v .CheckLinux ()... )
102103 msgs = append (msgs , v .CheckHooks ()... )
103104
@@ -335,6 +336,24 @@ func (v *Validator) CheckMounts() (msgs []string) {
335336 return
336337}
337338
339+ func (v * Validator ) CheckOS () (msgs []string ) {
340+ logrus .Debugf ("check os" )
341+
342+ if v .spec .Platform .OS != "linux" {
343+ if v .spec .Linux != nil {
344+ msgs = append (msgs , fmt .Sprintf ("'linux' MUST NOT set when platform.os is %q" , v .spec .Platform .OS ))
345+ }
346+ }
347+
348+ if v .spec .Platform .OS != "solaris" {
349+ if v .spec .Solaris != nil {
350+ msgs = append (msgs , fmt .Sprintf ("'solaris' MUST NOT set when platform.os is %q" , v .spec .Platform .OS ))
351+ }
352+ }
353+
354+ return
355+ }
356+
338357//Linux only
339358func (v * Validator ) CheckLinux () (msgs []string ) {
340359 logrus .Debugf ("check linux" )
You can’t perform that action at this time.
0 commit comments