in projects/aws/image-builder/cmd/build.go [382:396]
func validateOSVersion(os, osVersion string) error {
if os != builder.RedHat && os != builder.Ubuntu {
return fmt.Errorf("%s is not a supported OS", os)
}
if os == builder.Ubuntu && !builder.SliceContains(builder.SupportedUbuntuVersions, osVersion) {
return fmt.Errorf("%s is not a supported version of Ubuntu. Please select one of %s", osVersion, strings.Join(builder.SupportedUbuntuVersions, ","))
}
if os == builder.RedHat && !builder.SliceContains(builder.SupportedRedHatVersions, osVersion) {
return fmt.Errorf("%s is not a supported version of Redhat. Please select one of %s", osVersion, strings.Join(builder.SupportedRedHatVersions, ","))
}
return nil
}