Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (v *Validator) CheckAll() (msgs []string) {
msgs = append(msgs, v.CheckMounts()...)
msgs = append(msgs, v.CheckPlatform()...)
msgs = append(msgs, v.CheckProcess()...)
msgs = append(msgs, v.CheckOS()...)
msgs = append(msgs, v.CheckLinux()...)
msgs = append(msgs, v.CheckHooks()...)

Expand Down Expand Up @@ -343,6 +344,24 @@ func (v *Validator) CheckMounts() (msgs []string) {
return
}

func (v *Validator) CheckOS() (msgs []string) {
logrus.Debugf("check os")

if v.spec.Platform.OS != "linux" {
if v.spec.Linux != nil {
msgs = append(msgs, fmt.Sprintf("'linux' MUST NOT be set when platform.os is %q", v.spec.Platform.OS))
}
}

if v.spec.Platform.OS != "solaris" {
if v.spec.Solaris != nil {
msgs = append(msgs, fmt.Sprintf("'solaris' MUST NOT be set when platform.os is %q", v.spec.Platform.OS))
}
}

return
}

// CheckLinux checks v.spec.Linux
func (v *Validator) CheckLinux() (msgs []string) {
logrus.Debugf("check linux")
Expand Down