diff --git a/validate/validate.go b/validate/validate.go index 0c4ebb901..50dd6e9db 100644 --- a/validate/validate.go +++ b/validate/validate.go @@ -385,6 +385,7 @@ func (v *Validator) CheckMounts() (msgs []string) { return } +// CheckOS checks v.spec.Platform.OS func (v *Validator) CheckOS() (msgs []string) { logrus.Debugf("check os") @@ -400,6 +401,12 @@ func (v *Validator) CheckOS() (msgs []string) { } } + if v.spec.Platform.OS != "windows" { + if v.spec.Windows != nil { + msgs = append(msgs, fmt.Sprintf("'windows' MUST NOT be set when platform.os is %q", v.spec.Platform.OS)) + } + } + return }