Skip to content

Commit

Permalink
removed sfz forbidding validation (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-kun authored Apr 29, 2022
1 parent 8076953 commit 98cd853
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
3 changes: 0 additions & 3 deletions pkg/apis/gcp/validation/shoot.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ func ValidateWorkers(workers []core.Worker, fldPath *field.Path) field.ErrorList
continue
}

if worker.Maximum != 0 && worker.Minimum == 0 {
allErrs = append(allErrs, field.Forbidden(workerFldPath.Child("minimum"), "minimum value must be > 0 if maximum value > 0 (auto scaling to 0 is not supported)"))
}
}

return allErrs
Expand Down
15 changes: 0 additions & 15 deletions pkg/apis/gcp/validation/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,6 @@ var _ = Describe("#ValidateWorkers", func() {
))
})

It("should enforce workers min > 0 if max > 0", func() {
workersCopy := workers
workersCopy[0].Minimum = 0
workersCopy[0].Maximum = 1

errorList := ValidateWorkers(workersCopy, nil)

Expect(errorList).To(ConsistOf(
PointTo(MatchFields(IgnoreExtras, Fields{
"Type": Equal(field.ErrorTypeForbidden),
"Field": Equal("[0].minimum"),
})),
))
})

It("should forbid because worker does not specify a zone", func() {
workers[0].Zones = nil

Expand Down

0 comments on commit 98cd853

Please sign in to comment.