// ValidateDaemonSetUpdate tests if required fields in the DaemonSet are set. func ValidateDaemonSetUpdate(controller, oldController *extensions.DaemonSet) validation.ErrorList { allErrs := validation.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&controller.ObjectMeta, &oldController.ObjectMeta).Prefix("metadata")...) allErrs = append(allErrs, ValidateDaemonSetSpec(&controller.Spec).Prefix("spec")...) allErrs = append(allErrs, ValidateDaemonSetTemplateUpdate(controller.Spec.Template, oldController.Spec.Template).Prefix("spec.template")...) return allErrs }
func ValidateHorizontalPodAutoscalerStatusUpdate(controller, oldController *extensions.HorizontalPodAutoscaler) validation.ErrorList { allErrs := validation.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&controller.ObjectMeta, &oldController.ObjectMeta).Prefix("metadata")...) status := controller.Status allErrs = append(allErrs, apivalidation.ValidatePositiveField(int64(status.CurrentReplicas), "currentReplicas")...) allErrs = append(allErrs, apivalidation.ValidatePositiveField(int64(status.DesiredReplicas), "desiredReplicas")...) return allErrs }
// TODO: add other common fields that require global validation. func validateCommonFields(obj, old runtime.Object) utilvalidation.ErrorList { allErrs := utilvalidation.ErrorList{} objectMeta, err := api.ObjectMetaFor(obj) if err != nil { return append(allErrs, utilvalidation.NewInternalError("metadata", err)) } oldObjectMeta, err := api.ObjectMetaFor(old) if err != nil { return append(allErrs, utilvalidation.NewInternalError("metadata", err)) } allErrs = append(allErrs, validation.ValidateObjectMetaUpdate(objectMeta, oldObjectMeta)...) return allErrs }
func ValidateHorizontalPodAutoscalerUpdate(newAutoscler, oldAutoscaler *extensions.HorizontalPodAutoscaler) validation.ErrorList { allErrs := validation.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&newAutoscler.ObjectMeta, &oldAutoscaler.ObjectMeta).Prefix("metadata")...) allErrs = append(allErrs, validateHorizontalPodAutoscalerSpec(newAutoscler.Spec)...) return allErrs }
// ValidateIngressStatusUpdate tests if required fields in the Ingress are set when updating status. func ValidateIngressStatusUpdate(ingress, oldIngress *extensions.Ingress) validation.ErrorList { allErrs := validation.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&ingress.ObjectMeta, &oldIngress.ObjectMeta).Prefix("metadata")...) allErrs = append(allErrs, apivalidation.ValidateLoadBalancerStatus(&ingress.Status.LoadBalancer).Prefix("status.loadBalancer")...) return allErrs }
// ValidateIngressUpdate tests if required fields in the Ingress are set. func ValidateIngressUpdate(ingress, oldIngress *extensions.Ingress) validation.ErrorList { allErrs := validation.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&ingress.ObjectMeta, &oldIngress.ObjectMeta).Prefix("metadata")...) allErrs = append(allErrs, ValidateIngressSpec(&ingress.Spec).Prefix("spec")...) return allErrs }
func ValidateJobUpdateStatus(job, oldJob *extensions.Job) validation.ErrorList { allErrs := validation.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&oldJob.ObjectMeta, &job.ObjectMeta).Prefix("metadata")...) allErrs = append(allErrs, ValidateJobStatusUpdate(job.Status, oldJob.Status).Prefix("status")...) return allErrs }
func ValidateDeploymentUpdate(update, old *extensions.Deployment) validation.ErrorList { allErrs := validation.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&update.ObjectMeta, &old.ObjectMeta).Prefix("metadata")...) allErrs = append(allErrs, ValidateDeploymentSpec(&update.Spec).Prefix("spec")...) return allErrs }
// ValidateDaemonSetStatus validates tests if required fields in the DaemonSet Status section func ValidateDaemonSetStatusUpdate(controller, oldController *extensions.DaemonSet) validation.ErrorList { allErrs := validation.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&controller.ObjectMeta, &oldController.ObjectMeta).Prefix("metadata")...) allErrs = append(allErrs, validateDaemonSetStatus(&controller.Status)...) return allErrs }
func ValidateThirdPartyResourceUpdate(update, old *extensions.ThirdPartyResource) validation.ErrorList { allErrs := validation.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&update.ObjectMeta, &old.ObjectMeta).Prefix("metadata")...) allErrs = append(allErrs, ValidateThirdPartyResource(update)...) return allErrs }