Skip to content

Commit

Permalink
Merge pull request #9955 from kargakis/validate-minreadyseconds-properly
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Jul 24, 2016
2 parents 607ad7f + b8682b5 commit 5c862c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pkg/deploy/api/validation/validation.go
Expand Up @@ -44,6 +44,10 @@ func ValidateDeploymentConfigSpec(spec deployapi.DeploymentConfigSpec) field.Err
allErrs = append(allErrs, kapivalidation.ValidateNonnegativeField(int64(*spec.RevisionHistoryLimit), specPath.Child("revisionHistoryLimit"))...)
}
allErrs = append(allErrs, kapivalidation.ValidateNonnegativeField(int64(spec.MinReadySeconds), specPath.Child("minReadySeconds"))...)
if int64(spec.MinReadySeconds) >= deployapi.DefaultRollingTimeoutSeconds {
allErrs = append(allErrs, field.Invalid(specPath.Child("minReadySeconds"), spec.MinReadySeconds,
fmt.Sprintf("must be less than the deployment timeout (%ds)", deployapi.DefaultRollingTimeoutSeconds)))
}
if spec.Template == nil {
allErrs = append(allErrs, field.Required(specPath.Child("template"), ""))
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/extended/deployments/deployments.go
Expand Up @@ -551,7 +551,7 @@ var _ = g.Describe("deploymentconfigs", func() {
})

g.Describe("with minimum ready seconds set", func() {
g.It("should include various info in status [Conformance]", func() {
g.It("should not transition the deployment to Complete before satisfied [Conformance]", func() {
_, name, err := createFixture(oc, minReadySecondsFixture)
o.Expect(err).NotTo(o.HaveOccurred())

Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/deployment-min-ready-seconds.yaml
Expand Up @@ -4,7 +4,7 @@ metadata:
name: minreadytest
spec:
replicas: 2
minReadySeconds: 1000
minReadySeconds: 500
selector:
name: minreadytest
template:
Expand Down

0 comments on commit 5c862c0

Please sign in to comment.