Skip to content

Commit ed5723d

Browse files
committed
prevent s2i from running onbuild images
1 parent c55c799 commit ed5723d

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

pkg/build/builder/sti.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ func (s *S2IBuilder) Build() error {
190190
CGroupLimits: s.cgLimits,
191191
Injections: injections,
192192
ScriptDownloadProxyConfig: scriptDownloadProxyConfig,
193+
BlockOnBuild: true,
193194
}
194195

195196
if s.build.Spec.Strategy.SourceStrategy.ForcePull {
@@ -343,13 +344,13 @@ func (d *downloader) Download(config *s2iapi.Config) (*s2iapi.SourceInfo, error)
343344
// 2. In case of repeated Keys, the last Value takes precedence right here,
344345
// instead of deferring what to do with repeated environment variables to the
345346
// Docker runtime.
346-
func buildEnvVars(build *api.Build) map[string]string {
347+
func buildEnvVars(build *api.Build) s2iapi.EnvironmentList {
347348
bi := buildInfo(build)
348-
envVars := make(map[string]string, len(bi))
349+
envVars := &s2iapi.EnvironmentList{}
349350
for _, item := range bi {
350-
envVars[item.Key] = item.Value
351+
envVars.Set(fmt.Sprintf("%s=%s", item.Key, item.Value))
351352
}
352-
return envVars
353+
return *envVars
353354
}
354355

355356
// scriptProxyConfig determines a proxy configuration for downloading

test/extended/builds/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
exutil "github.com/openshift/origin/test/extended/util"
1111
)
1212

13-
var _ = g.Describe("[builds][Slow] the source-to-image build should support proxies", func() {
13+
var _ = g.Describe("[builds][Slow] the s2i build should support proxies", func() {
1414
defer g.GinkgoRecover()
1515
var (
1616
buildFixture = exutil.FixturePath("..", "extended", "fixtures", "test-build-proxy.json")

test/extended/builds/s2i_env.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
exutil "github.com/openshift/origin/test/extended/util"
1313
)
1414

15-
var _ = g.Describe("[builds][Slow] source-to-image build with environment file in sources", func() {
15+
var _ = g.Describe("[builds][Slow] s2i build with environment file in sources", func() {
1616
defer g.GinkgoRecover()
1717
const (
1818
buildTestPod = "build-test-pod"

test/extended/builds/s2i_incremental.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
exutil "github.com/openshift/origin/test/extended/util"
1212
)
1313

14-
var _ = g.Describe("[builds][Slow] incremental source-to-image build", func() {
14+
var _ = g.Describe("[builds][Slow] incremental s2i build", func() {
1515
defer g.GinkgoRecover()
1616

1717
const (

0 commit comments

Comments
 (0)