Skip to content

Commit

Permalink
Update DeploymentValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiljindal committed Sep 19, 2015
1 parent e7d4426 commit 8e94a07
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/experimental/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func ValidateDeploymentSpec(spec *experimental.DeploymentSpec) errs.ValidationEr
allErrs := errs.ValidationErrorList{}
allErrs = append(allErrs, apivalidation.ValidateNonEmptySelector(spec.Selector, "selector")...)
allErrs = append(allErrs, apivalidation.ValidatePositiveField(int64(spec.Replicas), "replicas")...)
allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpecForRC(spec.Template, spec.Selector, spec.Replicas, "template")...)
allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpecForRC(spec.Template, nil, spec.Replicas, "template")...)
allErrs = append(allErrs, ValidateDeploymentStrategy(&spec.Strategy, "strategy")...)
allErrs = append(allErrs, apivalidation.ValidateLabelName(spec.UniqueLabelKey, "uniqueLabel")...)
return allErrs
Expand Down
6 changes: 0 additions & 6 deletions pkg/apis/experimental/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,6 @@ func TestValidateDeployment(t *testing.T) {
Namespace: api.NamespaceDefault,
},
}
// selector should match the labels in pod template.
invalidSelectorDeployment := validDeployment()
invalidSelectorDeployment.Spec.Selector = map[string]string{
"name": "def",
}
errorCases["selector does not match labels"] = invalidSelectorDeployment

// RestartPolicy should be always.
invalidRestartPolicyDeployment := validDeployment()
Expand Down

0 comments on commit 8e94a07

Please sign in to comment.