Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
pass an internal pod object to SCC admission control so it works
- Loading branch information
Showing
4 changed files
with
108 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| package builds | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| g "github.com/onsi/ginkgo" | ||
| o "github.com/onsi/gomega" | ||
|
|
||
| exutil "github.com/openshift/origin/test/extended/util" | ||
| s2istatus "github.com/openshift/source-to-image/pkg/util/status" | ||
| ) | ||
|
|
||
| var _ = g.Describe("[builds][Conformance] s2i build with a root user image", func() { | ||
| defer g.GinkgoRecover() | ||
|
|
||
| var ( | ||
| buildFixture = exutil.FixturePath("testdata", "s2i-build-root.yaml") | ||
| oc = exutil.NewCLI("s2i-build-root", exutil.KubeConfigPath()) | ||
| ) | ||
|
|
||
| g.JustBeforeEach(func() { | ||
| g.By("waiting for builder service account") | ||
| err := exutil.WaitForBuilderAccount(oc.AdminKubeClient().Core().ServiceAccounts(oc.Namespace())) | ||
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
| }) | ||
|
|
||
| g.Describe("Building using an image with a root default user", func() { | ||
| g.It("should fail the build immediately", func() { | ||
| oc.SetOutputDir(exutil.TestContext.OutputDir) | ||
|
|
||
| g.By(fmt.Sprintf("calling oc create -f %q", buildFixture)) | ||
| err := oc.Run("create").Args("-f", buildFixture).Execute() | ||
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
|
|
||
| g.By("starting a test build") | ||
| // this uses the build-quota dir as the binary input source on purpose - we don't really care what we upload | ||
| // to the build since it will fail before we ever consume the inputs. | ||
| br, _ := exutil.StartBuildAndWait(oc, "s2i-build-root", "--from-dir", exutil.FixturePath("testdata", "build-quota")) | ||
| br.AssertFailure() | ||
| o.Expect(string(br.Build.Status.Reason)).To(o.Equal(string(s2istatus.ReasonPullBuilderImageFailed))) | ||
| o.Expect(string(br.Build.Status.Message)).To(o.Equal(string(s2istatus.ReasonMessagePullBuilderImageFailed))) | ||
|
|
||
| }) | ||
| }) | ||
| }) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| kind: BuildConfig | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: s2i-build-root | ||
| creationTimestamp: | ||
| labels: | ||
| name: s2i-build-root | ||
| spec: | ||
| source: | ||
| binary: | ||
| asFile: '' | ||
| strategy: | ||
| type: Source | ||
| sourceStrategy: | ||
| from: | ||
| kind: DockerImage | ||
| name: centos |