Merge pull request #639 from rafael/validate_pods
Validate pod on create and update.
This commit is contained in:
@@ -281,6 +281,16 @@ func ValidateManifest(manifest *ContainerManifest) []error {
|
||||
return []error(allErrs)
|
||||
}
|
||||
|
||||
// Pod tests if required fields in the pod are set.
|
||||
func ValidatePod(pod *Pod) []error {
|
||||
allErrs := errorList{}
|
||||
if pod.ID == "" {
|
||||
allErrs.Append(makeInvalidError("Pod.ID", pod.ID))
|
||||
}
|
||||
allErrs.Append(ValidateManifest(&pod.DesiredState.Manifest)...)
|
||||
return []error(allErrs)
|
||||
}
|
||||
|
||||
// ValidateService tests if required fields in the service are set.
|
||||
func ValidateService(service *Service) []error {
|
||||
allErrs := errorList{}
|
||||
|
Reference in New Issue
Block a user