Skip to content

Commit f2ae88b

Browse files
authored
Merge pull request #356 from q384566678/check-windows
validate: add windows validation in checkos
2 parents b081a42 + 8543fe4 commit f2ae88b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

validate/validate.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ func (v *Validator) CheckMounts() (msgs []string) {
385385
return
386386
}
387387

388+
// CheckOS checks v.spec.Platform.OS
388389
func (v *Validator) CheckOS() (msgs []string) {
389390
logrus.Debugf("check os")
390391

@@ -400,6 +401,12 @@ func (v *Validator) CheckOS() (msgs []string) {
400401
}
401402
}
402403

404+
if v.spec.Platform.OS != "windows" {
405+
if v.spec.Windows != nil {
406+
msgs = append(msgs, fmt.Sprintf("'windows' MUST NOT be set when platform.os is %q", v.spec.Platform.OS))
407+
}
408+
}
409+
403410
return
404411
}
405412

0 commit comments

Comments
 (0)