Skip to content

Commit e986a9e

Browse files
author
Jim Minter
committed
run jenkins maven build in memory constrained pod
1 parent 549e0f0 commit e986a9e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/extended/builds/pipeline.go

+21
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
g "github.com/onsi/ginkgo"
1515
o "github.com/onsi/gomega"
1616

17+
v1 "k8s.io/api/core/v1"
18+
"k8s.io/apimachinery/pkg/api/resource"
1719
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1820

1921
buildapi "github.com/openshift/origin/pkg/build/apis/build"
@@ -151,6 +153,25 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
151153
g.By("waiting for builder service account")
152154
err := exutil.WaitForBuilderAccount(oc.KubeClient().Core().ServiceAccounts(oc.Namespace()))
153155
o.Expect(err).NotTo(o.HaveOccurred())
156+
157+
// additionally ensure that the build works in a memory constrained
158+
// environment
159+
_, err = oc.AdminKubeClient().Core().LimitRanges(oc.Namespace()).Create(&v1.LimitRange{
160+
ObjectMeta: metav1.ObjectMeta{
161+
Name: "limitrange",
162+
},
163+
Spec: v1.LimitRangeSpec{
164+
Limits: []v1.LimitRangeItem{
165+
{
166+
Type: v1.LimitTypeContainer,
167+
Default: v1.ResourceList{
168+
v1.ResourceMemory: resource.MustParse("512Mi"),
169+
},
170+
},
171+
},
172+
},
173+
})
174+
o.Expect(err).NotTo(o.HaveOccurred())
154175
})
155176

156177
g.AfterEach(func() {

0 commit comments

Comments
 (0)