Skip to content

Commit

Permalink
Merge pull request #20490 from adambkaplan/bugfix/s2i-fixes
Browse files Browse the repository at this point in the history
bump(*) and s2i symlink fix
  • Loading branch information
openshift-merge-robot authored Aug 1, 2018
2 parents 6d49023 + a8ad7cc commit 95c3a80
Show file tree
Hide file tree
Showing 59 changed files with 2,003 additions and 465 deletions.
10 changes: 6 additions & 4 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ import:
version: master
- package: github.com/openshift/library-go
version: master
# master already branched for 3.11
- package: github.com/openshift/service-serving-cert-signer
version: master
# master already branched for 3.11
- package: github.com/openshift/source-to-image
version: release-3.10
version: master

# forks third
# master
Expand Down
2 changes: 2 additions & 0 deletions pkg/build/builder/sti.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ func (s *S2IBuilder) Build() error {
CGroupLimits: s.cgLimits,
ScriptDownloadProxyConfig: scriptDownloadProxyConfig,
BlockOnBuild: true,

KeepSymlinks: true,
}

if len(resolvConfHostPath) != 0 {
Expand Down
2 changes: 1 addition & 1 deletion test/extended/builds/s2i_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var _ = g.Describe("[Feature:Builds][Slow] s2i build with environment file in so
o.Expect(err).NotTo(o.HaveOccurred())

g.By("starting a test build")
path := exutil.FixturePath("testdata", "builds", "sti-environment-build-app")
path := exutil.FixturePath("testdata", "builds", "s2i-environment-build-app")
br, _ := exutil.StartBuildAndWait(oc, "test", "--from-dir", path)
br.AssertSuccess()

Expand Down
35 changes: 35 additions & 0 deletions test/extended/builds/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package builds

import (
"fmt"
"os"
"os/exec"
"regexp"
"strings"
Expand All @@ -26,6 +27,7 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {
bcWithPRRef = exutil.FixturePath("testdata", "builds", "test-bc-with-pr-ref.yaml")
exampleGemfile = exutil.FixturePath("testdata", "builds", "test-build-app", "Gemfile")
exampleBuild = exutil.FixturePath("testdata", "builds", "test-build-app")
symlinkFixture = exutil.FixturePath("testdata", "builds", "test-symlink-build.yaml")
exampleGemfileURL = "https://raw.githubusercontent.com/openshift/ruby-hello-world/master/Gemfile"
exampleArchiveURL = "https://github.com/openshift/ruby-hello-world/archive/master.zip"
oc = exutil.NewCLI("cli-start-build", exutil.KubeConfigPath())
Expand Down Expand Up @@ -450,6 +452,39 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {
})
})

g.Describe("s2i build maintaining symlinks", func() {
g.It(fmt.Sprintf("should s2i build image and maintain symlinks"), func() {
g.By("initializing local repo")
repo, err := exutil.NewGitRepo("symlinks")
o.Expect(err).NotTo(o.HaveOccurred())
defer repo.Remove()
err = repo.AddAndCommit("package.json", "{}")
o.Expect(err).NotTo(o.HaveOccurred())

err = os.Symlink(repo.RepoPath+"/package.json", repo.RepoPath+"/link")
o.Expect(err).NotTo(o.HaveOccurred())

exutil.CheckOpenShiftNamespaceImageStreams(oc)
g.By(fmt.Sprintf("calling oc create -f %q", symlinkFixture))
err = oc.Run("create").Args("-f", symlinkFixture).Execute()
o.Expect(err).NotTo(o.HaveOccurred())

g.By("starting a build")
err = oc.Run("start-build").Args("symlink-bc", "--from-dir", repo.RepoPath).Execute()
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for build to finish")
err = exutil.WaitForABuild(oc.BuildClient().Build().Builds(oc.Namespace()), "symlink-bc-1", exutil.CheckBuildSuccess, exutil.CheckBuildFailed, nil)
if err != nil {
exutil.DumpBuildLogs("symlink-bc", oc)
}
o.Expect(err).NotTo(o.HaveOccurred())

tag, err := oc.ImageClient().Image().ImageStreamTags(oc.Namespace()).Get("symlink-is:latest", metav1.GetOptions{})
err = oc.Run("run").Args("-i", "-t", "symlink-test", "--image="+tag.Image.DockerImageReference, "--restart=Never", "--command", "--", "bash", "-c", "if [ ! -L link ]; then ls -ltr; exit 1; fi").Execute()
o.Expect(err).NotTo(o.HaveOccurred())
})
})
})
})
})
184 changes: 115 additions & 69 deletions test/extended/testdata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 95c3a80

Please sign in to comment.