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 @@ -103,6 +103,7 @@ func (v *Validator) CheckAll() (msgs []string) {
103103 msgs = append (msgs , v .CheckMounts ()... )
104104 msgs = append (msgs , v .CheckPlatform ()... )
105105 msgs = append (msgs , v .CheckProcess ()... )
106+ msgs = append (msgs , v .CheckOS ()... )
106107 msgs = append (msgs , v .CheckLinux ()... )
107108 msgs = append (msgs , v .CheckHooks ()... )
108109
@@ -343,6 +344,24 @@ func (v *Validator) CheckMounts() (msgs []string) {
343344 return
344345}
345346
347+ func (v * Validator ) CheckOS () (msgs []string ) {
348+ logrus .Debugf ("check os" )
349+
350+ if v .spec .Platform .OS != "linux" {
351+ if v .spec .Linux != nil {
352+ msgs = append (msgs , fmt .Sprintf ("'linux' MUST NOT be set when platform.os is %q" , v .spec .Platform .OS ))
353+ }
354+ }
355+
356+ if v .spec .Platform .OS != "solaris" {
357+ if v .spec .Solaris != nil {
358+ msgs = append (msgs , fmt .Sprintf ("'solaris' MUST NOT be set when platform.os is %q" , v .spec .Platform .OS ))
359+ }
360+ }
361+
362+ return
363+ }
364+
346365// CheckLinux checks v.spec.Linux
347366func (v * Validator ) CheckLinux () (msgs []string ) {
348367 logrus .Debugf ("check linux" )
You can’t perform that action at this time.
0 commit comments