diff --git a/Makefile b/Makefile index a4ba66838974..1051b5c352d9 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ verify: build { \ hack/verify-gofmt.sh ||r=1;\ hack/verify-govet.sh ||r=1;\ - hack/verify-generated-bootstrap-bindata.sh ||r=1;\ + hack/verify-generated-bindata.sh ||r=1;\ hack/verify-generated-deep-copies.sh ||r=1;\ hack/verify-generated-conversions.sh ||r=1;\ hack/verify-generated-clientsets.sh ||r=1;\ @@ -107,7 +107,7 @@ verify-commits: # Example: # make update update: build - hack/update-generated-bootstrap-bindata.sh + hack/update-generated-bindata.sh hack/update-generated-deep-copies.sh hack/update-generated-conversions.sh hack/update-generated-clientsets.sh diff --git a/hack/update-generated-bootstrap-bindata.sh b/hack/update-generated-bindata.sh similarity index 56% rename from hack/update-generated-bootstrap-bindata.sh rename to hack/update-generated-bindata.sh index b43962838c91..73b6cd43619a 100755 --- a/hack/update-generated-bootstrap-bindata.sh +++ b/hack/update-generated-bindata.sh @@ -32,6 +32,29 @@ pushd "${OS_ROOT}" > /dev/null ${EXAMPLES}/heapster/... \ ${EXAMPLES}/prometheus/... \ pkg/image/admission/imagepolicy/api/v1/... + +"$(os::util::find::gopath_binary go-bindata)" \ + -nocompress \ + -nometadata \ + -prefix "testextended" \ + -pkg "testdata" \ + -o "${OUTPUT_PARENT}/test/extended/testdata/bindata.go" \ + -ignore "\.DS_Store" \ + -ignore ".*\.(go|md)$" \ + test/extended/testdata/... \ + test/integration/testdata \ + examples/db-templates \ + examples/image-streams \ + examples/sample-app \ + examples/hello-openshift \ + examples/jenkins/... + popd > /dev/null +# If you hit this, please reduce other tests instead of importing more +if [[ "$( cat "${OUTPUT_PARENT}/test/extended/testdata/bindata.go" | wc -c )" -gt 650000 ]]; then + echo "error: extended bindata is $( cat "${OUTPUT_PARENT}/test/extended/testdata/bindata.go" | wc -c ) bytes, reduce the size of the import" 1>&2 + exit 1 +fi + ret=$?; ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"; exit "$ret" diff --git a/hack/util.sh b/hack/util.sh index 88ec2da59f59..c2d83f645e19 100644 --- a/hack/util.sh +++ b/hack/util.sh @@ -86,6 +86,7 @@ function find_files() { -o -wholename './pkg/assets/*/bindata.go' \ -o -wholename './pkg/bootstrap/bindata.go' \ -o -wholename './openshift.local.*' \ + -o -wholename './test/extended/testdata/bindata.go' \ -o -wholename '*/vendor/*' \ -o -wholename './assets/bower_components/*' \ \) -prune \ diff --git a/hack/verify-generated-bindata.sh b/hack/verify-generated-bindata.sh new file mode 100755 index 000000000000..583273a5d522 --- /dev/null +++ b/hack/verify-generated-bindata.sh @@ -0,0 +1,41 @@ +#!/bin/bash +source "$(dirname "${BASH_SOURCE}")/lib/init.sh" + +echo "===== Verifying Generated Bindata =====" + +TMP_GENERATED_BOOTSTRAP_DIR="_output/verify-bindata" + +echo "Generating bindata..." +if ! output=`OUTPUT_ROOT=${TMP_GENERATED_BOOTSTRAP_DIR} ${OS_ROOT}/hack/update-generated-bindata.sh 2>&1` +then + echo "FAILURE: Generation of fresh bindata failed:" + echo "$output" + exit 1 +fi + +echo "Diffing current bootstrap bindata against freshly generated bindata" +ret=0 +diff -Naup "${OS_ROOT}/pkg/bootstrap/bindata.go" "${TMP_GENERATED_BOOTSTRAP_DIR}/pkg/bootstrap/bindata.go" || ret=$? +if [[ $ret -eq 0 ]] +then + echo "SUCCESS: Generated bootstrap bindata up to date." +else + rm -rf "${TMP_GENERATED_BOOTSTRAP_DIR}" + echo "FAILURE: Generated bootstrap bindata out of date. Please run hack/update-generated-bindata.sh" + exit 1 +fi + +echo "Diffing current test/extended bindata against freshly generated bindata" +ret=0 +diff -Naup "${OS_ROOT}/test/extended/testdata/bindata.go" "${TMP_GENERATED_BOOTSTRAP_DIR}/test/extended/testdata/bindata.go" || ret=$? +rm -rf "${TMP_GENERATED_BOOTSTRAP_DIR}" +if [[ $ret -eq 0 ]] +then + echo "SUCCESS: Generated test/extended bindata up to date." +else + rm -rf "${TMP_GENERATED_BOOTSTRAP_DIR}" + echo "FAILURE: Generated test/extended bindata out of date. Please run hack/update-generated-bindata.sh" + exit 1 +fi + +rm -rf "${TMP_GENERATED_BOOTSTRAP_DIR}" diff --git a/hack/verify-generated-bootstrap-bindata.sh b/hack/verify-generated-bootstrap-bindata.sh deleted file mode 100755 index ae546708d23b..000000000000 --- a/hack/verify-generated-bootstrap-bindata.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -source "$(dirname "${BASH_SOURCE}")/lib/init.sh" - -echo "===== Verifying Generated Bootstrap Bindata =====" - -TMP_GENERATED_BOOTSTRAP_DIR="_output/verify-bootstrap-bindata" - -echo "Generating bootstrap bindata..." -if ! output=`OUTPUT_ROOT=${TMP_GENERATED_BOOTSTRAP_DIR} ${OS_ROOT}/hack/update-generated-bootstrap-bindata.sh 2>&1` -then - echo "FAILURE: Generation of fresh bindata failed:" - echo "$output" - exit 1 -fi - -echo "Diffing current bootstrap bindata against freshly generated bindata" -ret=0 -diff -Naup "${OS_ROOT}/pkg/bootstrap/bindata.go" "${TMP_GENERATED_BOOTSTRAP_DIR}/pkg/bootstrap/bindata.go" || ret=$? -rm -rf "${TMP_GENERATED_BOOTSTRAP_DIR}" -if [[ $ret -eq 0 ]] -then - echo "SUCCESS: Generated bootstrap bindata up to date." -else - echo "FAILURE: Generated bootstrap bindata out of date. Please run hack/update-generated-bootstrap-bindata.sh" - exit 1 -fi diff --git a/test/extended/alternate_certs.sh b/test/extended/alternate_certs.sh index c34276b7c38b..1d6128711059 100755 --- a/test/extended/alternate_certs.sh +++ b/test/extended/alternate_certs.sh @@ -6,8 +6,6 @@ source "$(dirname "${BASH_SOURCE}")/../../hack/lib/init.sh" os::cleanup::tmpdir os::util::environment::setup_all_server_vars -export EXTENDED_TEST_PATH="${OS_ROOT}/test/extended" - function cleanup() { out=$? diff --git a/test/extended/alternate_launches.sh b/test/extended/alternate_launches.sh index d0dc975fabe9..6aadf2328a9a 100755 --- a/test/extended/alternate_launches.sh +++ b/test/extended/alternate_launches.sh @@ -9,8 +9,6 @@ os::util::environment::use_sudo os::cleanup::tmpdir os::util::environment::setup_all_server_vars -export EXTENDED_TEST_PATH="${OS_ROOT}/test/extended" - function cleanup() { out=$? diff --git a/test/extended/builds/docker_quota.go b/test/extended/builds/docker_quota.go index 402e31aef4a5..3d1216058b16 100644 --- a/test/extended/builds/docker_quota.go +++ b/test/extended/builds/docker_quota.go @@ -2,6 +2,8 @@ package builds import ( "fmt" + "os" + "path/filepath" g "github.com/onsi/ginkgo" o "github.com/onsi/gomega" @@ -36,7 +38,9 @@ var _ = g.Describe("[builds][quota][Slow] docker build with a quota", func() { o.Expect(err).NotTo(o.HaveOccurred()) g.By("starting a test build") - br, err := exutil.StartBuildAndWait(oc, "docker-build-quota", "--from-dir", exutil.FixturePath("testdata", "build-quota")) + path := exutil.FixturePath("testdata", "build-quota") + o.Expect(os.Chmod(filepath.Join(path, ".s2i", "bin", "assemble"), 0755)).NotTo(o.HaveOccurred()) + br, err := exutil.StartBuildAndWait(oc, "docker-build-quota", "--from-dir", path) g.By("expecting the build is in Failed phase") br.AssertFailure() diff --git a/test/extended/builds/start.go b/test/extended/builds/start.go index 8724f1081f47..32d4d9f3887b 100644 --- a/test/extended/builds/start.go +++ b/test/extended/builds/start.go @@ -93,6 +93,12 @@ var _ = g.Describe("[builds][Slow] starting a build using CLI", func() { g.Describe("binary builds", func() { var commit string + // do a best effort to initialize the repo in case it is a raw checkout or temp dir + tryRepoInit := func(exampleBuild string) { + out, err := exec.Command("bash", "-c", fmt.Sprintf("cd %q; if ! git rev-parse --git-dir; then git init .; git add .; git commit -m 'first'; touch foo; git add .; git commit -m 'second'; fi; true", exampleBuild)).CombinedOutput() + fmt.Fprintf(g.GinkgoWriter, "Tried to init git repo: %v\n%s\n", err, string(out)) + } + g.It("should accept --from-file as input", func() { g.By("starting the build with a Dockerfile") br, err := exutil.StartBuildAndWait(oc, "sample-build", fmt.Sprintf("--from-file=%s", exampleGemfile)) @@ -120,6 +126,7 @@ var _ = g.Describe("[builds][Slow] starting a build using CLI", func() { g.It("should accept --from-repo as input", func() { g.By("starting the build with a Git repository") + tryRepoInit(exampleBuild) br, err := exutil.StartBuildAndWait(oc, "sample-build", fmt.Sprintf("--from-repo=%s", exampleBuild)) br.AssertSuccess() buildLog, err := br.Logs() @@ -133,6 +140,7 @@ var _ = g.Describe("[builds][Slow] starting a build using CLI", func() { g.It("should accept --from-repo with --commit as input", func() { g.By("starting the build with a Git repository") + tryRepoInit(exampleBuild) gitCmd := exec.Command("git", "rev-parse", "HEAD~1") gitCmd.Dir = exampleBuild commitByteArray, err := gitCmd.CombinedOutput() diff --git a/test/extended/networking.sh b/test/extended/networking.sh index 4c2af253edca..723a50fbd21a 100755 --- a/test/extended/networking.sh +++ b/test/extended/networking.sh @@ -208,7 +208,6 @@ function run-extended-tests() { fi export KUBECONFIG="${kubeconfig}" - export EXTENDED_TEST_PATH="${OS_ROOT}/test/extended" local test_args="--test.v '--ginkgo.skip=${skip_regex}' \ '--ginkgo.focus=${focus_regex}' ${TEST_EXTRA_ARGS}" @@ -230,7 +229,7 @@ function run-extended-tests() { fi fi - pushd "${EXTENDED_TEST_PATH}/networking" > /dev/null + pushd "${OS_ROOT}/test/extended/networking" > /dev/null eval "${test_cmd}; "'exit_status=${PIPESTATUS[0]}' popd > /dev/null diff --git a/test/extended/setup.sh b/test/extended/setup.sh index 7a4df4568c0f..a506cd0e3449 100644 --- a/test/extended/setup.sh +++ b/test/extended/setup.sh @@ -29,7 +29,6 @@ function os::test::extended::setup () { os::util::ensure::built_binary_exists 'junitmerge' # ensure proper relative directories are set - export EXTENDED_TEST_PATH="${OS_ROOT}/test/extended" export KUBE_REPO_ROOT="${OS_ROOT}/vendor/k8s.io/kubernetes" os::util::environment::setup_time_vars diff --git a/test/extended/testdata/bindata.go b/test/extended/testdata/bindata.go new file mode 100644 index 000000000000..620748dd4d20 --- /dev/null +++ b/test/extended/testdata/bindata.go @@ -0,0 +1,19028 @@ +// Code generated by go-bindata. +// sources: +// test/extended/testdata/build-extended/bc-scripts-by-url.yaml +// test/extended/testdata/build-extended/bc-scripts-in-repo.yaml +// test/extended/testdata/build-extended/bc-scripts-in-the-image.yaml +// test/extended/testdata/build-extended/jvm-runner-with-scripts.yaml +// test/extended/testdata/build-extended/jvm-runner.yaml +// test/extended/testdata/build-quota/.s2i/bin/assemble +// test/extended/testdata/build-quota/Dockerfile +// test/extended/testdata/build-secrets/Dockerfile +// test/extended/testdata/build-secrets/s2i-binary-dir/.s2i/bin/assemble +// test/extended/testdata/build-secrets/s2i-binary-dir/.s2i/bin/run +// test/extended/testdata/build-secrets/s2i-binary-dir/Gemfile +// test/extended/testdata/build-secrets/s2i-binary-dir/config.ru +// test/extended/testdata/build-secrets/test-docker-build.json +// test/extended/testdata/build-secrets/test-is.json +// test/extended/testdata/build-secrets/test-s2i-build.json +// test/extended/testdata/build-secrets/test-secret-2.json +// test/extended/testdata/build-secrets/test-secret.json +// test/extended/testdata/custom-secret-builder/Dockerfile +// test/extended/testdata/custom-secret-builder/build.sh +// test/extended/testdata/deployments/custom-deployment.yaml +// test/extended/testdata/deployments/deployment-example.yaml +// test/extended/testdata/deployments/deployment-history-limit.yaml +// test/extended/testdata/deployments/deployment-ignores-deployer.yaml +// test/extended/testdata/deployments/deployment-image-resolution.yaml +// test/extended/testdata/deployments/deployment-min-ready-seconds.yaml +// test/extended/testdata/deployments/deployment-simple.yaml +// test/extended/testdata/deployments/deployment-with-ref-env.yaml +// test/extended/testdata/deployments/failing-pre-hook.yaml +// test/extended/testdata/deployments/generation-test.yaml +// test/extended/testdata/deployments/multi-ict-deployment.yaml +// test/extended/testdata/deployments/paused-deployment.yaml +// test/extended/testdata/deployments/readiness-test.yaml +// test/extended/testdata/deployments/tag-images-deployment.yaml +// test/extended/testdata/deployments/test-deployment-broken.yaml +// test/extended/testdata/deployments/test-deployment-test.yaml +// test/extended/testdata/forcepull-test.json +// test/extended/testdata/gssapi/config/kubeconfig +// test/extended/testdata/gssapi/config/oauth_config.json +// test/extended/testdata/gssapi/fedora/base/Dockerfile +// test/extended/testdata/gssapi/fedora/kerberos/Dockerfile +// test/extended/testdata/gssapi/fedora/kerberos_configured/Dockerfile +// test/extended/testdata/gssapi/proxy/Dockerfile +// test/extended/testdata/gssapi/proxy/configure.sh +// test/extended/testdata/gssapi/proxy/gssapiproxy-buildconfig.yaml +// test/extended/testdata/gssapi/proxy/gssapiproxy-deploymentconfig.yaml +// test/extended/testdata/gssapi/proxy/gssapiproxy-imagestream.yaml +// test/extended/testdata/gssapi/proxy/gssapiproxy-service.yaml +// test/extended/testdata/gssapi/proxy/healthz +// test/extended/testdata/gssapi/proxy/kadm5.acl +// test/extended/testdata/gssapi/proxy/kdc.conf +// test/extended/testdata/gssapi/proxy/krb5.conf +// test/extended/testdata/gssapi/proxy/proxy.conf +// test/extended/testdata/gssapi/scripts/gssapi-tests.sh +// test/extended/testdata/gssapi/scripts/test-wrapper.sh +// test/extended/testdata/gssapi/ubuntu/base/Dockerfile +// test/extended/testdata/gssapi/ubuntu/kerberos/Dockerfile +// test/extended/testdata/gssapi/ubuntu/kerberos_configured/Dockerfile +// test/extended/testdata/hello-builder/Dockerfile +// test/extended/testdata/hello-builder/scripts/assemble +// test/extended/testdata/hello-builder/scripts/run +// test/extended/testdata/idling-echo-server-rc.yaml +// test/extended/testdata/idling-echo-server.yaml +// test/extended/testdata/image-pull-secrets/dc-with-new-pull-secret.yaml +// test/extended/testdata/image-pull-secrets/dc-with-old-pull-secret.yaml +// test/extended/testdata/image-pull-secrets/pod-with-new-pull-secret.yaml +// test/extended/testdata/image-pull-secrets/pod-with-no-pull-secret.yaml +// test/extended/testdata/image-pull-secrets/pod-with-old-pull-secret.yaml +// test/extended/testdata/incremental-auth-build.json +// test/extended/testdata/jenkins-plugin/build-job-clone.xml +// test/extended/testdata/jenkins-plugin/build-job-slave.xml +// test/extended/testdata/jenkins-plugin/build-job.xml +// test/extended/testdata/jenkins-plugin/build-with-env-job.xml +// test/extended/testdata/jenkins-plugin/build-with-exec-steps.xml +// test/extended/testdata/jenkins-plugin/create-job.xml +// test/extended/testdata/jenkins-plugin/delete-job-keys.xml +// test/extended/testdata/jenkins-plugin/delete-job-labels.xml +// test/extended/testdata/jenkins-plugin/delete-job.xml +// test/extended/testdata/jenkins-plugin/imagestream-scm-dsl-job.xml +// test/extended/testdata/jenkins-plugin/imagestream-scm-job.xml +// test/extended/testdata/jenkins-plugin/multitag-job.xml +// test/extended/testdata/jenkins-plugin/multitag-template.json +// test/extended/testdata/jenkins-plugin/shared-resources-template.json +// test/extended/testdata/jobs/v1.yaml +// test/extended/testdata/jobs/v1beta1.yaml +// test/extended/testdata/ldap/ldapserver-buildconfig.json +// test/extended/testdata/ldap/ldapserver-deploymentconfig.json +// test/extended/testdata/ldap/ldapserver-imagestream-testenv.json +// test/extended/testdata/ldap/ldapserver-imagestream.json +// test/extended/testdata/ldap/ldapserver-service.json +// test/extended/testdata/long_names/Dockerfile +// test/extended/testdata/long_names/fixture.json +// test/extended/testdata/roles/empty-role.yaml +// test/extended/testdata/roles/policy-clusterroles.yaml +// test/extended/testdata/roles/policy-roles.yaml +// test/extended/testdata/run_policy/parallel-bc.yaml +// test/extended/testdata/run_policy/serial-bc.yaml +// test/extended/testdata/run_policy/serial-latest-only-bc.yaml +// test/extended/testdata/s2i-dropcaps/root-access-build.yaml +// test/extended/testdata/s2i-dropcaps/rootable-ruby/Dockerfile +// test/extended/testdata/s2i-dropcaps/rootable-ruby/adduser +// test/extended/testdata/s2i-dropcaps/rootable-ruby/assemble +// test/extended/testdata/sample-image-stream.json +// test/extended/testdata/scoped-router.yaml +// test/extended/testdata/service-serving-cert/nginx-serving-cert.conf +// test/extended/testdata/statusfail-assemble/.s2i/bin/assemble +// test/extended/testdata/statusfail-failedassemble.yaml +// test/extended/testdata/statusfail-fetchbuilderimage.yaml +// test/extended/testdata/statusfail-fetchsourcedocker.yaml +// test/extended/testdata/statusfail-fetchsources2i.yaml +// test/extended/testdata/statusfail-postcommithook.yaml +// test/extended/testdata/statusfail-pushtoregistry.yaml +// test/extended/testdata/statusfail-runtimeartifacts.yaml +// test/extended/testdata/sti-environment-build-app/.sti/environment +// test/extended/testdata/sti-environment-build-app/Gemfile +// test/extended/testdata/sti-environment-build-app/config.ru +// test/extended/testdata/test-auth-build.yaml +// test/extended/testdata/test-build-app/Dockerfile +// test/extended/testdata/test-build-app/Gemfile +// test/extended/testdata/test-build-app/config.ru +// test/extended/testdata/test-build-podsvc.json +// test/extended/testdata/test-build-postcommit.json +// test/extended/testdata/test-build-proxy.json +// test/extended/testdata/test-build-revision.json +// test/extended/testdata/test-build.json +// test/extended/testdata/test-buildconfigsecretinjector.yaml +// test/extended/testdata/test-cds-dockerbuild.json +// test/extended/testdata/test-cds-sourcebuild.json +// test/extended/testdata/test-cli-debug.yaml +// test/extended/testdata/test-context-build.json +// test/extended/testdata/test-custom-build.json +// test/extended/testdata/test-docker-build-pullsecret.json +// test/extended/testdata/test-docker-build-quota.json +// test/extended/testdata/test-docker-build.json +// test/extended/testdata/test-docker-no-outputname.json +// test/extended/testdata/test-env-build.json +// test/extended/testdata/test-env-pod.json +// test/extended/testdata/test-gitserver-tokenauth.yaml +// test/extended/testdata/test-gitserver.yaml +// test/extended/testdata/test-imagesource-build.yaml +// test/extended/testdata/test-nosrc-build.json +// test/extended/testdata/test-s2i-build-quota.json +// test/extended/testdata/test-s2i-build.json +// test/extended/testdata/test-s2i-no-outputname.json +// test/extended/testdata/test-secret-build.json +// test/extended/testdata/test-secret.json +// test/extended/testdata/weighted-router.yaml +// test/integration/testdata/project-request-template-with-quota.yaml +// test/integration/testdata/test-buildcli-beta2.json +// test/integration/testdata/test-buildcli.json +// test/integration/testdata/test-deployment-config.yaml +// test/integration/testdata/test-egress-network-policy.json +// test/integration/testdata/test-image-stream-mapping.json +// test/integration/testdata/test-image-stream.json +// test/integration/testdata/test-image.json +// test/integration/testdata/test-route.json +// test/integration/testdata/test-service-with-finalizer.json +// test/integration/testdata/test-service.json +// examples/db-templates/mariadb-ephemeral-template.json +// examples/db-templates/mariadb-persistent-template.json +// examples/db-templates/mongodb-ephemeral-template.json +// examples/db-templates/mongodb-persistent-template.json +// examples/db-templates/mysql-ephemeral-template.json +// examples/db-templates/mysql-persistent-template.json +// examples/db-templates/postgresql-ephemeral-template.json +// examples/db-templates/postgresql-persistent-template.json +// examples/db-templates/redis-ephemeral-template.json +// examples/db-templates/redis-persistent-template.json +// examples/image-streams/image-streams-centos7.json +// examples/image-streams/image-streams-rhel7.json +// examples/sample-app/application-template-custombuild.json +// examples/sample-app/application-template-dockerbuild.json +// examples/sample-app/application-template-pullspecbuild.json +// examples/sample-app/application-template-stibuild.json +// examples/sample-app/cleanup.sh +// examples/sample-app/github-webhook-example.json +// examples/sample-app/pullimages.sh +// examples/hello-openshift/Dockerfile +// examples/hello-openshift/hello-pod.json +// examples/hello-openshift/hello-project.json +// examples/jenkins/application-template.json +// examples/jenkins/jenkins-ephemeral-template.json +// examples/jenkins/jenkins-persistent-template.json +// examples/jenkins/pipeline/bluegreen-pipeline.yaml +// examples/jenkins/pipeline/mapsapp-pipeline.yaml +// examples/jenkins/pipeline/maven-pipeline.yaml +// examples/jenkins/pipeline/openshift-client-plugin-pipeline.yaml +// examples/jenkins/pipeline/samplepipeline.yaml +// DO NOT EDIT! + +package testdata + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time" +) +type asset struct { + bytes []byte + info os.FileInfo +} + +type bindataFileInfo struct { + name string + size int64 + mode os.FileMode + modTime time.Time +} + +func (fi bindataFileInfo) Name() string { + return fi.name +} +func (fi bindataFileInfo) Size() int64 { + return fi.size +} +func (fi bindataFileInfo) Mode() os.FileMode { + return fi.mode +} +func (fi bindataFileInfo) ModTime() time.Time { + return fi.modTime +} +func (fi bindataFileInfo) IsDir() bool { + return false +} +func (fi bindataFileInfo) Sys() interface{} { + return nil +} + +var _testExtendedTestdataBuildExtendedBcScriptsByUrlYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: java-extended-build-from-url +spec: + source: + git: + uri: "https://github.com/openshift/test-maven-app.git" + strategy: + sourceStrategy: + from: + kind: ImageStreamTag + name: "wildfly:10.0" + namespace: openshift + runtimeImage: + kind: ImageStreamTag + name: "jvm-runner:0.1" + runtimeArtifacts: + - sourcePath: /opt/s2i/destination/src/target/hello.jar + env: + - name: USING_ENV_FROM_BUILD_CONFIG + value: "yes" + scripts: "https://raw.githubusercontent.com/openshift/test-maven-app/s2i-assemble-and-assemble-runtime/.s2i/bin" +`) + +func testExtendedTestdataBuildExtendedBcScriptsByUrlYamlBytes() ([]byte, error) { + return _testExtendedTestdataBuildExtendedBcScriptsByUrlYaml, nil +} + +func testExtendedTestdataBuildExtendedBcScriptsByUrlYaml() (*asset, error) { + bytes, err := testExtendedTestdataBuildExtendedBcScriptsByUrlYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-extended/bc-scripts-by-url.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildExtendedBcScriptsInRepoYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: java-extended-build-from-repo +spec: + source: + git: + uri: "https://github.com/openshift/test-maven-app.git" + ref: s2i-assemble-and-assemble-runtime + strategy: + sourceStrategy: + from: + kind: ImageStreamTag + name: "wildfly:10.0" + namespace: openshift + runtimeImage: + kind: ImageStreamTag + name: "jvm-runner:0.1" + runtimeArtifacts: + - sourcePath: /opt/s2i/destination/src/target/hello.jar + env: + - name: USING_ENV_FROM_BUILD_CONFIG + value: "yes" +`) + +func testExtendedTestdataBuildExtendedBcScriptsInRepoYamlBytes() ([]byte, error) { + return _testExtendedTestdataBuildExtendedBcScriptsInRepoYaml, nil +} + +func testExtendedTestdataBuildExtendedBcScriptsInRepoYaml() (*asset, error) { + bytes, err := testExtendedTestdataBuildExtendedBcScriptsInRepoYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-extended/bc-scripts-in-repo.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildExtendedBcScriptsInTheImageYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: java-extended-build-from-image +spec: + source: + git: + uri: "https://github.com/openshift/test-maven-app.git" + ref: s2i-assemble-only + strategy: + sourceStrategy: + from: + kind: ImageStreamTag + name: "wildfly:10.0" + namespace: openshift + runtimeImage: + kind: ImageStreamTag + name: "jvm-runner-with-scripts:0.1" + env: + - name: USING_ENV_FROM_BUILD_CONFIG + value: "yes" +`) + +func testExtendedTestdataBuildExtendedBcScriptsInTheImageYamlBytes() ([]byte, error) { + return _testExtendedTestdataBuildExtendedBcScriptsInTheImageYaml, nil +} + +func testExtendedTestdataBuildExtendedBcScriptsInTheImageYaml() (*asset, error) { + bytes, err := testExtendedTestdataBuildExtendedBcScriptsInTheImageYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-extended/bc-scripts-in-the-image.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildExtendedJvmRunnerWithScriptsYaml = []byte(`kind: List +apiVersion: v1 +items: + +- kind: ImageStream + apiVersion: v1 + metadata: + name: jvm-runner-with-scripts + +- kind: BuildConfig + apiVersion: v1 + metadata: + name: jvm-runner-with-scripts + spec: + source: + dockerfile: | + FROM jboss/base-jdk:8 + LABEL io.openshift.s2i.scripts-url "image:///usr/libexec/s2i" + LABEL io.openshift.s2i.assemble-input-files "/opt/s2i/destination/src/target/hello.jar" + USER root + RUN mkdir -p /usr/libexec/s2i && \ + curl -s https://raw.githubusercontent.com/openshift/test-maven-app/s2i-assemble-and-assemble-runtime/.s2i/bin/assemble-runtime | tee /usr/libexec/s2i/assemble-runtime && \ + chmod +x /usr/libexec/s2i/assemble-runtime && \ + curl -s https://raw.githubusercontent.com/openshift/test-maven-app/s2i-assemble-and-assemble-runtime/.s2i/bin/run | tee /usr/libexec/s2i/run && \ + chmod +x /usr/libexec/s2i/run + USER 1000 + strategy: + type: Docker + output: + to: + kind: ImageStreamTag + name: jvm-runner-with-scripts:0.1 +`) + +func testExtendedTestdataBuildExtendedJvmRunnerWithScriptsYamlBytes() ([]byte, error) { + return _testExtendedTestdataBuildExtendedJvmRunnerWithScriptsYaml, nil +} + +func testExtendedTestdataBuildExtendedJvmRunnerWithScriptsYaml() (*asset, error) { + bytes, err := testExtendedTestdataBuildExtendedJvmRunnerWithScriptsYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-extended/jvm-runner-with-scripts.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildExtendedJvmRunnerYaml = []byte(`kind: List +apiVersion: v1 +items: + +- kind: ImageStream + apiVersion: v1 + metadata: + name: jvm-runner + +- kind: BuildConfig + apiVersion: v1 + metadata: + name: jvm-runner + spec: + source: + dockerfile: | + FROM jboss/base-jdk:8 + USER 1000 + strategy: + type: Docker + output: + to: + kind: ImageStreamTag + name: jvm-runner:0.1 +`) + +func testExtendedTestdataBuildExtendedJvmRunnerYamlBytes() ([]byte, error) { + return _testExtendedTestdataBuildExtendedJvmRunnerYaml, nil +} + +func testExtendedTestdataBuildExtendedJvmRunnerYaml() (*asset, error) { + bytes, err := testExtendedTestdataBuildExtendedJvmRunnerYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-extended/jvm-runner.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildQuotaS2iBinAssemble = []byte(`#!/bin/sh + + +echo -n MEMORY= && cat /sys/fs/cgroup/memory/memory.limit_in_bytes +echo -n MEMORYSWAP= && cat /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes + +if [ -e /sys/fs/cgroup/cpuacct,cpu ]; then + quota=$( /secret_report.sh +RUN echo '(test -f /secrets/secret1 && echo -n "secret1=" && cat /secrets/secret1)' >> /secret_report.sh +RUN echo '(test -f /secret2 && echo -n "relative-secret2=" && cat /secret2)' >> /secret_report.sh +RUN chmod 755 /secret_report.sh + +CMD ["/bin/sh", "-c", "/secret_report.sh"] +`) + +func testExtendedTestdataBuildSecretsDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsDockerfile, nil +} + +func testExtendedTestdataBuildSecretsDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinAssemble = []byte(`#!/bin/bash + +# Copy secrets into a location they can be output during image run + +mkdir -p "${HOME}/testsecret" +if [[ -f /tmp/secret1 ]]; then + # Copy three secrets defined in testsecret fixture to directory + cp /tmp/secret? "${HOME}/testsecret" +else + echo "Unable to locate testsecret fixture files" + exit 1 +fi + +mkdir -p "${HOME}/testsecret2" +if [[ -f secret1 ]]; then + # Copy three secrets defined in testsecret2 fixture to directory + cp secret? "${HOME}/testsecret2" +else + echo "Unable to locate testsecret2 fixture files" + exit 2 +fi `) + +func testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinAssembleBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinAssemble, nil +} + +func testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinAssemble() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinAssembleBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/s2i-binary-dir/.s2i/bin/assemble", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinRun = []byte(`#!/bin/bash + +# Ensure none of the build config inject secrets still exist in the file system +for s in /tmp/secret? secret?; do + if [[ -s "${s}" ]]; then + echo "Found secret file which should have been removed: ${s}" + exit 1 + fi +done + +# Print out the secrets copied into the image during assemble +cd "${HOME}" +for s in testsecret/* testsecret2/*; do + echo -n "${s}=" && cat "${s}" +done`) + +func testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinRunBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinRun, nil +} + +func testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinRun() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinRunBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/s2i-binary-dir/.s2i/bin/run", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildSecretsS2iBinaryDirGemfile = []byte(`source "https://rubygems.org" + +gem "rack" +`) + +func testExtendedTestdataBuildSecretsS2iBinaryDirGemfileBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsS2iBinaryDirGemfile, nil +} + +func testExtendedTestdataBuildSecretsS2iBinaryDirGemfile() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsS2iBinaryDirGemfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/s2i-binary-dir/Gemfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildSecretsS2iBinaryDirConfigRu = []byte(`run Proc.new {|env| [200, {"Content-Type" => "text/html"}, [ENV['TEST_ENV']]]} +`) + +func testExtendedTestdataBuildSecretsS2iBinaryDirConfigRuBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsS2iBinaryDirConfigRu, nil +} + +func testExtendedTestdataBuildSecretsS2iBinaryDirConfigRu() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsS2iBinaryDirConfigRuBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/s2i-binary-dir/config.ru", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildSecretsTestDockerBuildJson = []byte(`{ + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "test", + "labels": { + "name": "test" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Binary", + "binary": {}, + "secrets": [ + { + "secret": { + "name": "testsecret" + }, + "destinationDir": "secret-dir" + }, + { + "secret": { + "name": "testsecret2" + } + } + ] + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + }, + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ] + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "test:latest" + } + } + } +}`) + +func testExtendedTestdataBuildSecretsTestDockerBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsTestDockerBuildJson, nil +} + +func testExtendedTestdataBuildSecretsTestDockerBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsTestDockerBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/test-docker-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildSecretsTestIsJson = []byte(`{ + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "test" + } +} +`) + +func testExtendedTestdataBuildSecretsTestIsJsonBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsTestIsJson, nil +} + +func testExtendedTestdataBuildSecretsTestIsJson() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsTestIsJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/test-is.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildSecretsTestS2iBuildJson = []byte(`{ + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "test", + "labels": { + "name": "test" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Binary", + "binary": {}, + "secrets": [ + { + "secret": { + "name": "testsecret" + }, + "destinationDir": "/tmp" + }, + { + "secret": { + "name": "testsecret2" + } + } + ] + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + }, + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ] + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "test:latest" + } + } + } +}`) + +func testExtendedTestdataBuildSecretsTestS2iBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsTestS2iBuildJson, nil +} + +func testExtendedTestdataBuildSecretsTestS2iBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsTestS2iBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/test-s2i-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildSecretsTestSecret2Json = []byte(`{ + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "testsecret2", + "creationTimestamp": null + }, + "data": { + "secret1": "c2VjcmV0MQo=", + "secret2": "c2VjcmV0Mgo=", + "secret3": "c2VjcmV0Mwo=" + }, + "type": "Opaque" +} +`) + +func testExtendedTestdataBuildSecretsTestSecret2JsonBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsTestSecret2Json, nil +} + +func testExtendedTestdataBuildSecretsTestSecret2Json() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsTestSecret2JsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/test-secret-2.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataBuildSecretsTestSecretJson = []byte(`{ + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "testsecret", + "creationTimestamp": null + }, + "data": { + "secret1": "c2VjcmV0MQo=", + "secret2": "c2VjcmV0Mgo=", + "secret3": "c2VjcmV0Mwo=" + }, + "type": "Opaque" +} +`) + +func testExtendedTestdataBuildSecretsTestSecretJsonBytes() ([]byte, error) { + return _testExtendedTestdataBuildSecretsTestSecretJson, nil +} + +func testExtendedTestdataBuildSecretsTestSecretJson() (*asset, error) { + bytes, err := testExtendedTestdataBuildSecretsTestSecretJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/build-secrets/test-secret.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataCustomSecretBuilderDockerfile = []byte(`FROM openshift/origin-custom-docker-builder +# Override the default build script +ADD build.sh /tmp/build.sh +`) + +func testExtendedTestdataCustomSecretBuilderDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataCustomSecretBuilderDockerfile, nil +} + +func testExtendedTestdataCustomSecretBuilderDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataCustomSecretBuilderDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/custom-secret-builder/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataCustomSecretBuilderBuildSh = []byte(`#!/bin/bash + +set -e +set -o pipefail + +if [ ! -e "${DOCKER_SOCKET}" ]; then + echo "Docker socket missing at ${DOCKER_SOCKET}" + exit 1 +fi + +SECRET_PATH=${PUSH_DOCKERCFG_PATH:-} + +if [ -z "${SECRET_PATH}" ]; then + echo "The dockercfg not found in /var/run/secrets/openshift.io/push" + exit 1 +fi + +if [ -n "${OUTPUT_IMAGE}" ]; then + TAG="${OUTPUT_REGISTRY}/${OUTPUT_IMAGE}" +fi + +mkdir -p /tmp/build && cd /tmp/build +cp -v $SECRET_PATH /tmp/build/dockercfg +chmod 0666 /tmp/build/dockercfg + +# This ruby app just output content of file referenced by the environment +# variable. For example FOO=/tmp/test and then GET /FOO returns content of +# /tmp/test +cat > config.ru <<- EOF +def readfile(name); File.read(ENV[name]) rescue "not found #{ENV[name]}"; end +run Proc.new { |env| + path = env['PATH_INFO'].gsub(/^\//,'') + [200, {"Content-Type" => "text/raw"}, [readfile(path)]] +} +EOF + +cat > Dockerfile <<- EOF +FROM centos/ruby-22-centos7 +ENV SECRET_FILE /opt/openshift/src/dockercfg +COPY dockercfg ./ +COPY config.ru ./ +CMD /usr/local/sti/run +EOF + +docker build --rm -t "${TAG}" . +docker push "${TAG}" +`) + +func testExtendedTestdataCustomSecretBuilderBuildShBytes() ([]byte, error) { + return _testExtendedTestdataCustomSecretBuilderBuildSh, nil +} + +func testExtendedTestdataCustomSecretBuilderBuildSh() (*asset, error) { + bytes, err := testExtendedTestdataCustomSecretBuilderBuildShBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/custom-secret-builder/build.sh", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsCustomDeploymentYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: custom-deployment +spec: + replicas: 2 + selector: + name: custom-deployment + strategy: + type: Rolling + rollingParams: + pre: + failurePolicy: Abort + execNewPod: + containerName: myapp + command: + - /bin/echo + - test pre hook executed + customParams: + command: + - /bin/sh + - -c + - | + set -e + openshift-deploy --until=50% + echo Halfway + openshift-deploy + echo Finished + sleep 1 + template: + metadata: + labels: + name: custom-deployment + spec: + terminationGracePeriodSeconds: 0 + containers: + - image: "docker.io/centos:centos7" + imagePullPolicy: IfNotPresent + name: myapp + command: + - /bin/sleep + - "10" + triggers: + - type: ConfigChange +`) + +func testExtendedTestdataDeploymentsCustomDeploymentYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsCustomDeploymentYaml, nil +} + +func testExtendedTestdataDeploymentsCustomDeploymentYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsCustomDeploymentYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/custom-deployment.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsDeploymentExampleYaml = []byte(`apiVersion: v1 +items: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + labels: + app: example + name: example + spec: + replicas: 1 + template: + metadata: + labels: + app: example + spec: + containers: + - imagePullPolicy: Always + name: ruby + command: + - /bin/sleep + - "100" + ports: + - containerPort: 8080 + protocol: TCP + - imagePullPolicy: Always + name: mongodb + command: + - /bin/sleep + - "100" + ports: + - containerPort: 5000 + protocol: TCP + test: false + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - ruby + from: + kind: ImageStreamTag + name: ruby:latest + namespace: openshift + type: ImageChange + - imageChangeParams: + automatic: true + containerNames: + - mongodb + from: + kind: ImageStreamTag + name: mongodb:latest + namespace: openshift + type: ImageChange +kind: List +`) + +func testExtendedTestdataDeploymentsDeploymentExampleYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsDeploymentExampleYaml, nil +} + +func testExtendedTestdataDeploymentsDeploymentExampleYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsDeploymentExampleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/deployment-example.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsDeploymentHistoryLimitYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: history-limit +spec: + replicas: 1 + selector: + name: history-limit + strategy: + type: Rolling + rollingParams: + pre: + failurePolicy: Abort + execNewPod: + containerName: myapp + command: + - /bin/echo + - test pre hook executed + template: + metadata: + labels: + name: history-limit + spec: + containers: + - image: "docker.io/centos:centos7" + imagePullPolicy: IfNotPresent + name: myapp + command: + - /bin/sleep + - "100" + triggers: + - type: ConfigChange + revisionHistoryLimit: 3 +`) + +func testExtendedTestdataDeploymentsDeploymentHistoryLimitYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsDeploymentHistoryLimitYaml, nil +} + +func testExtendedTestdataDeploymentsDeploymentHistoryLimitYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsDeploymentHistoryLimitYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/deployment-history-limit.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsDeploymentIgnoresDeployerYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + annotations: + deploy.openshift.io/deployer-pod.ignore: "true" + name: database +spec: + replicas: 1 + selector: + name: database + template: + metadata: + labels: + name: database + spec: + terminationGracePeriodSeconds: 0 + containers: + - image: "docker.io/centos:centos7" + imagePullPolicy: IfNotPresent + name: myapp + command: + - /bin/sleep + - "10000" +`) + +func testExtendedTestdataDeploymentsDeploymentIgnoresDeployerYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsDeploymentIgnoresDeployerYaml, nil +} + +func testExtendedTestdataDeploymentsDeploymentIgnoresDeployerYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsDeploymentIgnoresDeployerYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/deployment-ignores-deployer.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsDeploymentImageResolutionYaml = []byte(`apiVersion: v1 +kind: List +items: +- apiVersion: v1 + kind: ImageStream + metadata: + name: deployment-image-resolution + spec: + tags: + - name: pullthrough + from: + kind: DockerImage + name: docker.io/centos:centos7 + referencePolicy: + type: Local + - name: direct + from: + kind: DockerImage + name: docker.io/centos:centos7 + referencePolicy: + type: Source +- apiVersion: v1 + kind: DeploymentConfig + metadata: + name: deployment-image-resolution + spec: + strategy: + type: Rolling + rollingParams: + template: + metadata: + labels: + name: deployment-image-resolution + spec: + containers: + - name: first + image: "" + imagePullPolicy: IfNotPresent + command: + - /bin/sleep + - infinity + - name: second + image: "" + imagePullPolicy: IfNotPresent + command: + - /bin/sleep + - infinity + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - first + from: + kind: ImageStreamTag + name: deployment-image-resolution:pullthrough + type: ImageChange + - imageChangeParams: + automatic: true + containerNames: + - second + from: + kind: ImageStreamTag + name: deployment-image-resolution:direct + type: ImageChange +`) + +func testExtendedTestdataDeploymentsDeploymentImageResolutionYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsDeploymentImageResolutionYaml, nil +} + +func testExtendedTestdataDeploymentsDeploymentImageResolutionYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsDeploymentImageResolutionYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/deployment-image-resolution.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsDeploymentMinReadySecondsYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: minreadytest +spec: + replicas: 2 + minReadySeconds: 500 + selector: + name: minreadytest + template: + metadata: + labels: + name: minreadytest + spec: + terminationGracePeriodSeconds: 0 + containers: + - image: "docker.io/centos:centos7" + imagePullPolicy: IfNotPresent + name: myapp + command: + - /bin/sleep + - "10000" +`) + +func testExtendedTestdataDeploymentsDeploymentMinReadySecondsYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsDeploymentMinReadySecondsYaml, nil +} + +func testExtendedTestdataDeploymentsDeploymentMinReadySecondsYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsDeploymentMinReadySecondsYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/deployment-min-ready-seconds.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsDeploymentSimpleYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: deployment-simple +spec: + replicas: 2 + selector: + name: deployment-simple + strategy: + type: Rolling + rollingParams: + template: + metadata: + labels: + name: deployment-simple + spec: + containers: + - image: "docker.io/centos:centos7" + imagePullPolicy: IfNotPresent + command: + - /bin/sleep + - infinity + name: myapp + readinessProbe: + exec: + command: + - uptime + triggers: + - type: ConfigChange +`) + +func testExtendedTestdataDeploymentsDeploymentSimpleYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsDeploymentSimpleYaml, nil +} + +func testExtendedTestdataDeploymentsDeploymentSimpleYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsDeploymentSimpleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/deployment-simple.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsDeploymentWithRefEnvYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: deployment-simple +spec: + triggers: [] + replicas: 1 + selector: + name: deployment-simple + strategy: + type: Rolling + rollingParams: + pre: + failurePolicy: Abort + execNewPod: + containerName: myapp + env: + - name: HELLO + valueFrom: + configMapKeyRef: + name: test + key: foo + command: ["/bin/bash", "-c", "echo hello ${HELLO} && exit 1"] + template: + metadata: + labels: + name: deployment-simple + spec: + containers: + - image: "openshift/origin-base:latest" + command: [ "/bin/bash", "-c", "sleep infinity" ] + imagePullPolicy: IfNotPresent + name: myapp +`) + +func testExtendedTestdataDeploymentsDeploymentWithRefEnvYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsDeploymentWithRefEnvYaml, nil +} + +func testExtendedTestdataDeploymentsDeploymentWithRefEnvYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsDeploymentWithRefEnvYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/deployment-with-ref-env.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsFailingPreHookYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: hook +spec: + replicas: 1 + selector: + name: hook + strategy: + type: Rolling + rollingParams: + pre: + failurePolicy: Retry + execNewPod: + containerName: myapp + command: + - /bin/bash + - -c + - '/bin/echo pre hook logs ; exit 1' + template: + metadata: + labels: + name: hook + spec: + containers: + - image: "docker.io/centos:centos7" + command: + - /bin/sleep + - infinity + name: myapp + triggers: + - type: ConfigChange +`) + +func testExtendedTestdataDeploymentsFailingPreHookYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsFailingPreHookYaml, nil +} + +func testExtendedTestdataDeploymentsFailingPreHookYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsFailingPreHookYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/failing-pre-hook.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsGenerationTestYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: generation-test +spec: + replicas: 1 + selector: + name: generation-test + strategy: + type: Rolling + rollingParams: + pre: + failurePolicy: Abort + execNewPod: + containerName: myapp + command: + - /bin/echo + - test pre hook executed + template: + metadata: + labels: + name: generation-test + spec: + containers: + - image: "docker.io/centos:centos7" + imagePullPolicy: IfNotPresent + name: myapp + command: + - /bin/sleep + - "100" + triggers: + - type: ConfigChange +`) + +func testExtendedTestdataDeploymentsGenerationTestYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsGenerationTestYaml, nil +} + +func testExtendedTestdataDeploymentsGenerationTestYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsGenerationTestYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/generation-test.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsMultiIctDeploymentYaml = []byte(`apiVersion: v1 +items: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + labels: + app: example + name: example + spec: + replicas: 1 + template: + metadata: + labels: + app: example + spec: + containers: + - imagePullPolicy: Always + name: ruby + command: + - /bin/sleep + - "100" + ports: + - containerPort: 8080 + protocol: TCP + - imagePullPolicy: Always + name: ruby2 + command: + - /bin/sleep + - "100" + ports: + - containerPort: 8081 + protocol: TCP + test: false + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - ruby + - ruby2 + from: + kind: ImageStreamTag + name: ruby:latest + namespace: openshift + type: ImageChange +kind: List +`) + +func testExtendedTestdataDeploymentsMultiIctDeploymentYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsMultiIctDeploymentYaml, nil +} + +func testExtendedTestdataDeploymentsMultiIctDeploymentYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsMultiIctDeploymentYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/multi-ict-deployment.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsPausedDeploymentYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: paused +spec: + paused: true + replicas: 1 + template: + metadata: + labels: + name: paused + spec: + containers: + - image: "docker.io/centos:centos7" + imagePullPolicy: IfNotPresent + name: myapp + command: + - /bin/sleep + - "100" +`) + +func testExtendedTestdataDeploymentsPausedDeploymentYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsPausedDeploymentYaml, nil +} + +func testExtendedTestdataDeploymentsPausedDeploymentYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsPausedDeploymentYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/paused-deployment.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsReadinessTestYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: readiness +spec: + replicas: 1 + strategy: + rollingParams: + timeoutSeconds: 30 + type: Rolling + template: + metadata: + labels: + name: readiness-test + spec: + containers: + - command: + - /bin/sleep + - "10000" + image: docker.io/centos:centos7 + imagePullPolicy: IfNotPresent + name: never-ready + readinessProbe: + exec: + command: + - /bin/false + failureThreshold: 1 +`) + +func testExtendedTestdataDeploymentsReadinessTestYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsReadinessTestYaml, nil +} + +func testExtendedTestdataDeploymentsReadinessTestYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsReadinessTestYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/readiness-test.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsTagImagesDeploymentYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: tag-images +spec: + replicas: 1 + test: true + selector: + name: tag-images + strategy: + type: Recreate + recreateParams: + timeoutSeconds: 600 + post: + failurePolicy: Abort + tagImages: + - containerName: sample-name + to: + kind: ImageStreamTag + name: sample-stream:deployed + template: + metadata: + labels: + name: tag-images + spec: + containers: + - image: openshift/origin-pod + imagePullPolicy: IfNotPresent + name: sample-name + ports: + - containerPort: 8080 + protocol: TCP + resources: + limits: + cpu: 100m + memory: 3Gi +`) + +func testExtendedTestdataDeploymentsTagImagesDeploymentYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsTagImagesDeploymentYaml, nil +} + +func testExtendedTestdataDeploymentsTagImagesDeploymentYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsTagImagesDeploymentYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/tag-images-deployment.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsTestDeploymentBrokenYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: brokendeployment +spec: + replicas: 1 + selector: + name: brokendeployment + strategy: + type: Rolling + rollingParams: + pre: + failurePolicy: Abort + execNewPod: + containerName: myapp + command: + - /bin/false + template: + metadata: + labels: + name: brokendeployment + spec: + containers: + - image: "docker.io/centos:centos7" + imagePullPolicy: IfNotPresent + name: myapp + command: + - /bin/sleep + - "100" + triggers: + - type: ConfigChange +`) + +func testExtendedTestdataDeploymentsTestDeploymentBrokenYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsTestDeploymentBrokenYaml, nil +} + +func testExtendedTestdataDeploymentsTestDeploymentBrokenYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsTestDeploymentBrokenYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/test-deployment-broken.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataDeploymentsTestDeploymentTestYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: deployment-test +spec: + replicas: 2 + selector: + name: deployment-test + strategy: + type: Rolling + rollingParams: + pre: + failurePolicy: Abort + execNewPod: + containerName: myapp + command: + - /bin/echo + - test pre hook executed + template: + metadata: + labels: + name: deployment-test + spec: + terminationGracePeriodSeconds: 0 + containers: + - image: "docker.io/centos:centos7" + imagePullPolicy: IfNotPresent + name: myapp + command: + - /bin/sleep + - "100" + test: true + triggers: + - type: ConfigChange +`) + +func testExtendedTestdataDeploymentsTestDeploymentTestYamlBytes() ([]byte, error) { + return _testExtendedTestdataDeploymentsTestDeploymentTestYaml, nil +} + +func testExtendedTestdataDeploymentsTestDeploymentTestYaml() (*asset, error) { + bytes, err := testExtendedTestdataDeploymentsTestDeploymentTestYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/deployments/test-deployment-test.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataForcepullTestJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build-tc", + "creationTimestamp": null, + "labels": { + "name": "ruby-sample-build-tc" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Custom", + "customStrategy": { + "from": { + "kind": "ImageStreamTag", + "namespace": "openshift", + "name": "ruby:latest" + }, + "env": [ + { + "name": "OPENSHIFT_CUSTOM_BUILD_BASE_IMAGE", + "value": "ruby:latest" + }, + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ], + "exposeDockerSocket": true, + "forcePull": true + } + } + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build-td", + "creationTimestamp": null, + "labels": { + "name": "ruby-sample-build-td" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "ImageStreamTag", + "namespace": "openshift", + "name": "ruby:latest" + }, + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ], + "forcePull": true + } + } + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build-ts", + "creationTimestamp": null, + "labels": { + "name": "ruby-sample-build-ts" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "ImageStreamTag", + "namespace": "openshift", + "name": "ruby:latest" + }, + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ], + "forcePull": true + } + } + } + } + ] +} +`) + +func testExtendedTestdataForcepullTestJsonBytes() ([]byte, error) { + return _testExtendedTestdataForcepullTestJson, nil +} + +func testExtendedTestdataForcepullTestJson() (*asset, error) { + bytes, err := testExtendedTestdataForcepullTestJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/forcepull-test.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiConfigKubeconfig = []byte(`apiVersion: v1 +clusters: +- cluster: + certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt + server: https://openshift.default.svc.cluster.local:443 + name: GSSAPITEST +contexts: +- context: + cluster: GSSAPITEST + namespace: gssapiproxy + name: gssapi +current-context: gssapi +kind: Config +preferences: {} +users: [] +`) + +func testExtendedTestdataGssapiConfigKubeconfigBytes() ([]byte, error) { + return _testExtendedTestdataGssapiConfigKubeconfig, nil +} + +func testExtendedTestdataGssapiConfigKubeconfig() (*asset, error) { + bytes, err := testExtendedTestdataGssapiConfigKubeconfigBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/config/kubeconfig", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiConfigOauth_configJson = []byte(`{ + "oauthConfig": { + "identityProviders": [{ + "name": "header", + "challenge": true, + "mappingMethod": "add", + "provider": { + "apiVersion": "v1", + "kind": "RequestHeaderIdentityProvider", + "challengeURL": "http://HOST_NAME/mod_auth/oauth/authorize?${query}", + "headers": ["Remote-User"] + } + }] + } +} +`) + +func testExtendedTestdataGssapiConfigOauth_configJsonBytes() ([]byte, error) { + return _testExtendedTestdataGssapiConfigOauth_configJson, nil +} + +func testExtendedTestdataGssapiConfigOauth_configJson() (*asset, error) { + bytes, err := testExtendedTestdataGssapiConfigOauth_configJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/config/oauth_config.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiFedoraBaseDockerfile = []byte(`# Clone from the Fedora 23 image +FROM fedora:23 + +ARG REALM +ARG HOST + +ENV REALM ${REALM} +ENV HOST ${HOST} + +ENV CLIENT CLIENT_HAS_LIBS + +ENV OS_ROOT /run/os +ENV KUBECONFIG ${OS_ROOT}/kubeconfig +ENV PATH ${OS_ROOT}/bin:${PATH} + +WORKDIR ${OS_ROOT} +ADD gssapi-tests.sh gssapi-tests.sh +ADD test-wrapper.sh test-wrapper.sh +ADD kubeconfig kubeconfig +ADD hack hack +ADD oc bin/oc + +# KEYRING does not work inside of a container since it is part of the kernel +RUN sed -i.bak1 's#KEYRING:persistent:#DIR:/tmp/krb5cc_#' /etc/krb5.conf && \ + dnf install -y findutils bc && \ + chmod +x gssapi-tests.sh test-wrapper.sh + +ENTRYPOINT /run/os/test-wrapper.sh +`) + +func testExtendedTestdataGssapiFedoraBaseDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataGssapiFedoraBaseDockerfile, nil +} + +func testExtendedTestdataGssapiFedoraBaseDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataGssapiFedoraBaseDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/fedora/base/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiFedoraKerberosDockerfile = []byte(`FROM gssapiproxy/fedora-gssapi-base + +ENV CLIENT CLIENT_HAS_LIBS + +RUN dnf install -y krb5-workstation +`) + +func testExtendedTestdataGssapiFedoraKerberosDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataGssapiFedoraKerberosDockerfile, nil +} + +func testExtendedTestdataGssapiFedoraKerberosDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataGssapiFedoraKerberosDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/fedora/kerberos/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiFedoraKerberos_configuredDockerfile = []byte(`FROM gssapiproxy/fedora-gssapi-kerberos + +ENV CLIENT CLIENT_HAS_LIBS_IS_CONFIGURED + +RUN sed -i.bak1 -e "s/\[realms\]/\[realms\]\n${REALM} = {\n kdc = ${HOST}\n admin_server = ${HOST}\n default_domain = ${HOST}\n}/" /etc/krb5.conf && \ + sed -i.bak2 -e "s/\[domain_realm\]/\[domain_realm\]\n.${HOST} = ${REALM}\n${HOST} = ${REALM}/" /etc/krb5.conf && \ + sed -i.bak3 -e "s!# default_realm = ! default_realm = ${REALM}\n#!" /etc/krb5.conf +`) + +func testExtendedTestdataGssapiFedoraKerberos_configuredDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataGssapiFedoraKerberos_configuredDockerfile, nil +} + +func testExtendedTestdataGssapiFedoraKerberos_configuredDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataGssapiFedoraKerberos_configuredDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/fedora/kerberos_configured/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyDockerfile = []byte(`# Clone from the Fedora 23 image +FROM fedora:23 + +# Install GSSAPI +RUN dnf install -y \ + apr-util-openssl \ + authconfig \ + httpd \ + krb5-libs \ + krb5-server \ + krb5-workstation \ + mod_auth_gssapi \ + mod_ssl \ + && dnf clean all + +# Add conf files for Kerberos +ADD krb5.conf /etc/krb5.conf +ADD kdc.conf /var/kerberos/krb5kdc/kdc.conf +ADD kadm5.acl /var/kerberos/krb5kdc/kadm5.acl + +# Add conf file for Apache +ADD proxy.conf /etc/httpd/conf.d/proxy.conf + +# Add health check file +ADD healthz /var/www/html/healthz + +# 80 = http +# 443 = https +# 88 = kerberos +EXPOSE 80 443 88 88/udp + +ADD configure.sh /usr/sbin/configure.sh +ENTRYPOINT /usr/sbin/configure.sh +`) + +func testExtendedTestdataGssapiProxyDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyDockerfile, nil +} + +func testExtendedTestdataGssapiProxyDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyConfigureSh = []byte(`#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +cd / + +# Get environment +export USER="$(whoami)" + +# Edit kerberos config files, replacing EXAMPLE.COM with ${REALM}, and example.com with ${HOST} +for file in /etc/krb5.conf /var/kerberos/krb5kdc/kdc.conf /var/kerberos/krb5kdc/kadm5.acl; do + sed -i.bak1 -e "s/EXAMPLE\.COM/${REALM}/g" $file + sed -i.bak2 -e "s/example\.com/${HOST}/g" $file +done + +# Create ticket database +kdb5_util create -s -r "${REALM}" -P password + +# Add local user as admin +kadmin.local -q "addprinc -pw password ${USER}/admin@${REALM}" + +# Start ticket server +krb5kdc + +# Add user principal for current user, for test users user1-user5, the host principal (for ssh), the HTTP principal (for Apache), and create keytab +for u in "${USER}" user1 user2 user3 user4 user5; do + kadmin.local -q "addprinc -pw password ${u}@${REALM}" +done + +# Setup keytab for sshd +kadmin.local -q "addprinc -randkey host/${HOST}@${REALM}" +kadmin.local -q "ktadd -k /etc/krb5.keytab host/${HOST}@${REALM}" + +# Setup keytab for apache +kadmin.local -q "addprinc -randkey HTTP/${HOST}@${REALM}" +kadmin.local -q "ktadd -k /etc/httpd.keytab HTTP/${HOST}@${REALM}" +chown apache /etc/httpd.keytab + +# configure Apache proxy and auth +sed -i.bak1 -e "s#proxy\.example\.com#${HOST}#g" /etc/httpd/conf.d/proxy.conf +sed -i.bak2 -e "s#https://backend\.example\.com#${BACKEND}#g" /etc/httpd/conf.d/proxy.conf + +# Start apache +httpd -k start + +# Keep the service running +while true ; do sleep 60 ; done +`) + +func testExtendedTestdataGssapiProxyConfigureShBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyConfigureSh, nil +} + +func testExtendedTestdataGssapiProxyConfigureSh() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyConfigureShBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/configure.sh", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyGssapiproxyBuildconfigYaml = []byte(`kind: "BuildConfig" +apiVersion: "v1" +metadata: + name: "gssapiproxy" + labels: + name: "gssapiproxy" +spec: + triggers: [] + source: + type: "Binary" + binary: {} + strategy: + type: "Docker" + env: + - + name: "BUILD_LOGLEVEL" + value: "5" + dockerStrategy: + from: + kind: "DockerImage" + name: "fedora:23" + output: + to: + kind: "ImageStreamTag" + name: "gssapiproxy:latest" +`) + +func testExtendedTestdataGssapiProxyGssapiproxyBuildconfigYamlBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyGssapiproxyBuildconfigYaml, nil +} + +func testExtendedTestdataGssapiProxyGssapiproxyBuildconfigYaml() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyGssapiproxyBuildconfigYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/gssapiproxy-buildconfig.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyGssapiproxyDeploymentconfigYaml = []byte(`kind: "DeploymentConfig" +apiVersion: "v1" +metadata: + name: "gssapiproxy-server" + creationTimestamp: null +spec: + strategy: + type: "Recreate" + resources: {} + triggers: + - + type: "ImageChange" + imageChangeParams: + automatic: true + containerNames: + - "gssapiproxy-server" + from: + kind: "ImageStreamTag" + name: "gssapiproxy:latest" + lastTriggeredImage: "" + - + type: "ConfigChange" + replicas: 1 + selector: + name: "gssapiproxy-server" + template: + metadata: + creationTimestamp: null + labels: + name: "gssapiproxy-server" + spec: + containers: + - + name: "gssapiproxy-server" + image: "gssapiproxy" + ports: + - + containerPort: 80 + protocol: "TCP" + - + containerPort: 443 + protocol: "TCP" + - + containerPort: 88 + protocol: "TCP" + - + containerPort: 88 + protocol: "UDP" + resources: {} + terminationMessagePath: "/dev/termination-log" + imagePullPolicy: "IfNotPresent" + capabilities: {} + securityContext: + capabilities: {} + privileged: false + runAsUser: 0 + readinessProbe: + httpGet: + path: "/healthz" + port: 80 + initialDelaySeconds: 15 + timeoutSeconds: 1 + restartPolicy: "Always" + dnsPolicy: "ClusterFirst" + serviceAccount: "" +status: {} +`) + +func testExtendedTestdataGssapiProxyGssapiproxyDeploymentconfigYamlBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyGssapiproxyDeploymentconfigYaml, nil +} + +func testExtendedTestdataGssapiProxyGssapiproxyDeploymentconfigYaml() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyGssapiproxyDeploymentconfigYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/gssapiproxy-deploymentconfig.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyGssapiproxyImagestreamYaml = []byte(`kind: "ImageStream" +apiVersion: "v1" +metadata: + name: "gssapiproxy" + creationTimestamp: null +`) + +func testExtendedTestdataGssapiProxyGssapiproxyImagestreamYamlBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyGssapiproxyImagestreamYaml, nil +} + +func testExtendedTestdataGssapiProxyGssapiproxyImagestreamYaml() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyGssapiproxyImagestreamYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/gssapiproxy-imagestream.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyGssapiproxyServiceYaml = []byte(`kind: "Service" +apiVersion: "v1" +metadata: + name: "gssapiproxy-server" + creationTimestamp: null +spec: + ports: + - + name: "http" + protocol: "TCP" + port: 80 + targetPort: 80 + nodePort: 0 + - + name: "https" + protocol: "TCP" + port: 443 + targetPort: 443 + nodePort: 0 + - + name: "kerberos" + protocol: "TCP" + port: 88 + targetPort: 88 + nodePort: 0 + - + name: "kerberos-udp" + protocol: "UDP" + port: 88 + targetPort: 88 + nodePort: 0 + selector: + name: "gssapiproxy-server" + type: "ClusterIP" + sessionAffinity: "None" +status: + loadBalancer: {} +`) + +func testExtendedTestdataGssapiProxyGssapiproxyServiceYamlBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyGssapiproxyServiceYaml, nil +} + +func testExtendedTestdataGssapiProxyGssapiproxyServiceYaml() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyGssapiproxyServiceYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/gssapiproxy-service.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyHealthz = []byte(`ok +`) + +func testExtendedTestdataGssapiProxyHealthzBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyHealthz, nil +} + +func testExtendedTestdataGssapiProxyHealthz() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyHealthzBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/healthz", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyKadm5Acl = []byte(`*/admin@EXAMPLE.COM * +`) + +func testExtendedTestdataGssapiProxyKadm5AclBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyKadm5Acl, nil +} + +func testExtendedTestdataGssapiProxyKadm5Acl() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyKadm5AclBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/kadm5.acl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyKdcConf = []byte(`[kdcdefaults] + kdc_ports = 88 + kdc_tcp_ports = 88 + +[realms] + EXAMPLE.COM = { + #master_key_type = aes256-cts + acl_file = /var/kerberos/krb5kdc/kadm5.acl + dict_file = /usr/share/dict/words + admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab + supported_enctypes = aes256-cts:normal aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal camellia256-cts:normal camellia128-cts:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:normal + } +`) + +func testExtendedTestdataGssapiProxyKdcConfBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyKdcConf, nil +} + +func testExtendedTestdataGssapiProxyKdcConf() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyKdcConfBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/kdc.conf", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyKrb5Conf = []byte(`[logging] + default = FILE:/var/log/krb5libs.log + kdc = FILE:/var/log/krb5kdc.log + admin_server = FILE:/var/log/kadmind.log + +[libdefaults] + dns_lookup_realm = false + ticket_lifetime = 24h + renew_lifetime = 7d + forwardable = true + rdns = false + default_realm = EXAMPLE.COM + default_ccache_name = DIR:/tmp/krb5cc_%{uid} + +[appdefaults] +pam = { + debug = true + dns_lookup_realm = false + ticket_lifetime = 24h + renew_lifetime = 7d + forwardable = true + rdns = false + default_realm = EXAMPLE.COM + default_ccache_name = DIR:/tmp/krb5cc_%{uid} +} + +[realms] +EXAMPLE.COM = { + kdc = example.com + admin_server = example.com + default_domain = example.com +} + +[domain_realm] +.example.com = EXAMPLE.COM +example.com = EXAMPLE.COM +`) + +func testExtendedTestdataGssapiProxyKrb5ConfBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyKrb5Conf, nil +} + +func testExtendedTestdataGssapiProxyKrb5Conf() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyKrb5ConfBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/krb5.conf", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiProxyProxyConf = []byte(`ServerName proxy.example.com + +SSLProxyEngine On +SSLProxyCheckPeerCN Off +SSLProxyCheckPeerName Off +SSLProxyCheckPeerExpire Off + + + # In order to use the basic-auth proxy, an X-Csrf-Token must be present + # Fail anything that doesn't have that header + RewriteEngine On + RewriteCond %{REQUEST_URI} ^/mod_auth/? + RewriteCond %{HTTP:X-Csrf-Token} ^$ [NC] + RewriteRule ^.* - [F,L] + + + + + ProxyPass https://backend.example.com/ + Require valid-user + + AuthType GSSAPI + AuthName "GSSAPI Login" + RequestHeader set Remote-User %{REMOTE_USER}s + + + # Kerberos auth-protected + GssapiCredStore keytab:/etc/httpd.keytab + + + + GssapiCredStore keytab:/etc/httpd.keytab + GssapiBasicAuth on + + + + +RequestHeader unset Remote-User +RequestHeader unset X-Remote-User +`) + +func testExtendedTestdataGssapiProxyProxyConfBytes() ([]byte, error) { + return _testExtendedTestdataGssapiProxyProxyConf, nil +} + +func testExtendedTestdataGssapiProxyProxyConf() (*asset, error) { + bytes, err := testExtendedTestdataGssapiProxyProxyConfBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/proxy/proxy.conf", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiScriptsGssapiTestsSh = []byte(`#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +echo "Running ${TEST_NAME}" + +cd "${OS_ROOT}" +source hack/lib/init.sh + +function cleanup() { + out=$? + # get the jUnit output file into a workable state in case we crashed in the middle of testing something + os::test::junit::reconcile_output + # check that we didn't mangle jUnit output + os::test::junit::check_test_counters + exit $out +} + +trap "cleanup" EXIT +os::test::junit::declare_suite_start "${TEST_NAME}" + +# Client has no GSSAPI libs and server is GSSAPI only +# Everything fails +# Errors do NOT mention Kerberos + +if [[ "${CLIENT}" = 'CLIENT_MISSING_LIBS' && "${SERVER}" = 'SERVER_GSSAPI_ONLY' ]]; then + + os::cmd::expect_failure_and_text 'oc login' 'Login failed \(401 Unauthorized\)' + os::cmd::expect_failure_and_text 'oc whoami' 'system:anonymous' + + os::cmd::expect_failure_and_text 'oc login -u user1' 'Login failed \(401 Unauthorized\)' + os::cmd::expect_failure_and_not_text 'oc whoami' 'user1' + + os::cmd::expect_failure_and_text 'oc login -u user2 -p wrongpassword' 'Login failed \(401 Unauthorized\)' + os::cmd::expect_failure_and_not_text 'oc whoami' 'user2' + + os::cmd::expect_failure_and_text 'oc login -u user2 -p password' 'Login failed \(401 Unauthorized\)' + os::cmd::expect_failure_and_not_text 'oc whoami' 'user2' + + os::cmd::expect_failure_and_text "oc login -u 'user3@${REALM}'" 'Login failed \(401 Unauthorized\)' + os::cmd::expect_failure_and_not_text 'oc whoami' 'user3' + + os::cmd::expect_failure_and_text "oc login -u 'user4@${REALM}' -p wrongpassword" 'Login failed \(401 Unauthorized\)' + os::cmd::expect_failure_and_not_text 'oc whoami' 'user4' + + os::cmd::expect_failure_and_text "oc login -u 'user5@${REALM}' -p password" 'Login failed \(401 Unauthorized\)' + os::cmd::expect_failure_and_not_text 'oc whoami' 'user5' + +fi + +# Client has uncofigured GSSAPI libs and server is GSSAPI only +# Everything fails +# Errors mention Kerberos + +if [[ "${CLIENT}" = 'CLIENT_HAS_LIBS' && "${SERVER}" = 'SERVER_GSSAPI_ONLY' ]]; then + + DEFAULT_REALM="$(grep default_realm /etc/krb5.conf | awk {'printf $3'})" + + os::cmd::expect_failure_and_text 'oc login' 'No Kerberos credentials available' + os::cmd::expect_failure_and_text 'oc whoami' 'system:anonymous' + + # Fedora has no default realm, so a realm-less username is considered invalid + # Ubuntu has a default realm, so will complain about not finding the credentials for it + # Hence we accept either of those error messages in the next three sets of tests + os::cmd::expect_failure_and_text 'oc login -u user1' "An invalid name was supplied|Can't find client principal user1@${DEFAULT_REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user1' + + os::cmd::expect_failure_and_text 'oc login -u user2 -p wrongpassword' "An invalid name was supplied|Can't find client principal user2@${DEFAULT_REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user2' + + os::cmd::expect_failure_and_text 'oc login -u user2 -p password' "An invalid name was supplied|Can't find client principal user2@${DEFAULT_REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user2' + + os::cmd::expect_failure_and_text "oc login -u 'user3@${REALM}'" "Can't find client principal user3@${REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user3' + + os::cmd::expect_failure_and_text "oc login -u 'user4@${REALM}' -p wrongpassword" "Can't find client principal user4@${REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user4' + + os::cmd::expect_failure_and_text "oc login -u 'user5@${REALM}' -p password" "Can't find client principal user5@${REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user5' + +fi + +# Client has GSSAPI configured and server is GSSAPI only +# Only GSSAPI works +# Errors mention Kerberos + +if [[ "${CLIENT}" = 'CLIENT_HAS_LIBS_IS_CONFIGURED' && "${SERVER}" = 'SERVER_GSSAPI_ONLY' ]]; then + + # No ticket + os::cmd::expect_failure_and_text 'oc login' 'No Kerberos credentials available' + os::cmd::expect_failure_and_text 'oc whoami' 'system:anonymous' + + os::cmd::expect_failure 'kinit user1 <<< wrongpassword' + os::cmd::expect_failure_and_text 'oc login' 'No Kerberos credentials available' + os::cmd::expect_failure_and_not_text 'oc whoami' 'user1' + + # Single ticket + os::cmd::expect_success 'kinit user1 <<< password' + os::cmd::expect_success_and_text 'oc login' 'Login successful.' + os::cmd::expect_success_and_text 'oc whoami' "user1@${REALM}" + os::cmd::expect_success_and_text 'oc logout' "user1@${REALM}" + + # Having multiple tickets + os::cmd::expect_success "kinit user2@${REALM} <<< password" + os::cmd::expect_success 'kinit user3 <<< password' + os::cmd::expect_failure 'kinit user4 <<< wrongpassword' + os::cmd::expect_failure "kinit user5@${REALM} <<< wrongpassword" + + # Shortname, non-default ticket + os::cmd::expect_success_and_text 'oc login -u user1' 'Login successful.' + os::cmd::expect_success_and_text 'oc whoami' "user1@${REALM}" + os::cmd::expect_success_and_text 'oc logout' "user1@${REALM}" + + # Longname, non-default ticket + os::cmd::expect_success_and_text "oc login -u 'user2@${REALM}'" 'Login successful.' + os::cmd::expect_success_and_text 'oc whoami' "user2@${REALM}" + os::cmd::expect_success_and_text 'oc logout' "user2@${REALM}" + + # Default ticket + os::cmd::expect_success_and_text 'oc login' 'Login successful.' + os::cmd::expect_success_and_text 'oc whoami' "user3@${REALM}" + os::cmd::expect_success_and_text 'oc logout' "user3@${REALM}" + + # Non-ticket users + os::cmd::expect_failure_and_text 'oc login -u user4' "Can't find client principal user4@${REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user4' + os::cmd::expect_failure_and_text "oc login -u 'user4@${REALM}'" "Can't find client principal user4@${REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user4' + + os::cmd::expect_failure_and_text 'oc login -u user4 -p password' "Can't find client principal user4@${REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user4' + os::cmd::expect_failure_and_text "oc login -u 'user4@${REALM}' -p password" "Can't find client principal user4@${REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user4' + + os::cmd::expect_failure_and_text 'oc login -u user5 -p wrongpassword' "Can't find client principal user5@${REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user5' + os::cmd::expect_failure_and_text "oc login -u 'user5@${REALM}' -p wrongpassword" "Can't find client principal user5@${REALM} in cache collection" + os::cmd::expect_failure_and_not_text 'oc whoami' 'user5' + + # Password is ignored if you have the ticket for the user + os::cmd::expect_success_and_text 'oc login -u user1 -p wrongpassword' 'Login successful.' + os::cmd::expect_success_and_text 'oc whoami' "user1@${REALM}" + os::cmd::expect_success_and_text 'oc logout' "user1@${REALM}" + os::cmd::expect_success_and_text "oc login -u 'user2@${REALM}' -p wrongpassword" 'Login successful.' + os::cmd::expect_success_and_text 'oc whoami' "user2@${REALM}" + os::cmd::expect_success_and_text 'oc logout' "user2@${REALM}" + +fi + +# Client has no GSSAPI libs or unconfigured GSSAPI libs and server is GSSAPI with Basic fallback +# Only BASIC works +# Errors do NOT mention Kerberos + +if [[ ( "${CLIENT}" = 'CLIENT_MISSING_LIBS' || "${CLIENT}" = 'CLIENT_HAS_LIBS' ) && "${SERVER}" = 'SERVER_GSSAPI_BASIC_FALLBACK' ]]; then + + os::cmd::expect_failure_and_text 'oc login <<< \n' 'Login failed \(401 Unauthorized\)' + os::cmd::expect_failure_and_text 'oc whoami' 'system:anonymous' + + os::cmd::expect_failure_and_text 'oc login -u user1 <&1; then + return_code=$? +fi + +cat "${JUNIT_REPORT_OUTPUT}" 1>&2 +exit "${return_code:-0}" +`) + +func testExtendedTestdataGssapiScriptsTestWrapperShBytes() ([]byte, error) { + return _testExtendedTestdataGssapiScriptsTestWrapperSh, nil +} + +func testExtendedTestdataGssapiScriptsTestWrapperSh() (*asset, error) { + bytes, err := testExtendedTestdataGssapiScriptsTestWrapperShBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/scripts/test-wrapper.sh", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiUbuntuBaseDockerfile = []byte(`# Clone from the Ubuntu 16.04 LTS image +FROM ubuntu:16.04 + +ARG REALM +ARG HOST + +ENV REALM ${REALM} +ENV HOST ${HOST} + +ENV CLIENT CLIENT_MISSING_LIBS + +ENV OS_ROOT /run/os +ENV KUBECONFIG ${OS_ROOT}/kubeconfig +ENV PATH ${OS_ROOT}/bin:${PATH} + +WORKDIR ${OS_ROOT} +ADD gssapi-tests.sh gssapi-tests.sh +ADD test-wrapper.sh test-wrapper.sh +ADD kubeconfig kubeconfig +ADD hack hack +ADD oc bin/oc + +RUN chmod +x gssapi-tests.sh test-wrapper.sh && \ + apt-get update && apt-get install -y bc + +ENTRYPOINT /run/os/test-wrapper.sh +`) + +func testExtendedTestdataGssapiUbuntuBaseDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataGssapiUbuntuBaseDockerfile, nil +} + +func testExtendedTestdataGssapiUbuntuBaseDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataGssapiUbuntuBaseDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/ubuntu/base/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiUbuntuKerberosDockerfile = []byte(`FROM gssapiproxy/ubuntu-gssapi-base + +ENV CLIENT CLIENT_HAS_LIBS + +RUN apt-get install -y krb5-user +`) + +func testExtendedTestdataGssapiUbuntuKerberosDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataGssapiUbuntuKerberosDockerfile, nil +} + +func testExtendedTestdataGssapiUbuntuKerberosDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataGssapiUbuntuKerberosDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/ubuntu/kerberos/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataGssapiUbuntuKerberos_configuredDockerfile = []byte(`FROM gssapiproxy/ubuntu-gssapi-kerberos + +ENV CLIENT CLIENT_HAS_LIBS_IS_CONFIGURED + +RUN sed -i.bak1 -e "s/\[realms\]/\[realms\]\n${REALM} = {\n kdc = ${HOST}\n admin_server = ${HOST}\n default_domain = ${HOST}\n}/" /etc/krb5.conf && \ + sed -i.bak2 -e "s/\[domain_realm\]/\[domain_realm\]\n.${HOST} = ${REALM}\n${HOST} = ${REALM}/" /etc/krb5.conf && \ + sed -i.bak3 -e "s!default_realm = !default_realm = ${REALM}\ndefault_ccache_name = DIR:/tmp/krb5cc_%{uid}\n#!" /etc/krb5.conf +`) + +func testExtendedTestdataGssapiUbuntuKerberos_configuredDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataGssapiUbuntuKerberos_configuredDockerfile, nil +} + +func testExtendedTestdataGssapiUbuntuKerberos_configuredDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataGssapiUbuntuKerberos_configuredDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/gssapi/ubuntu/kerberos_configured/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataHelloBuilderDockerfile = []byte(`FROM openshift/origin-release:latest +LABEL io.openshift.s2i.scripts-url=image:///usr/libexec/s2i +ENV STI_SCRIPTS_PATH=/usr/libexec/s2i +COPY scripts $STI_SCRIPTS_PATH +RUN chown 1001 /openshifttmp +USER 1001 +`) + +func testExtendedTestdataHelloBuilderDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataHelloBuilderDockerfile, nil +} + +func testExtendedTestdataHelloBuilderDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataHelloBuilderDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/hello-builder/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataHelloBuilderScriptsAssemble = []byte(`#!/bin/sh +unset GOPATH +cd /tmp/src +CGO_ENABLED=0 go build -a -installsuffix cgo -o hello-openshift -tags netgo +mv hello-openshift /tmp +`) + +func testExtendedTestdataHelloBuilderScriptsAssembleBytes() ([]byte, error) { + return _testExtendedTestdataHelloBuilderScriptsAssemble, nil +} + +func testExtendedTestdataHelloBuilderScriptsAssemble() (*asset, error) { + bytes, err := testExtendedTestdataHelloBuilderScriptsAssembleBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/hello-builder/scripts/assemble", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataHelloBuilderScriptsRun = []byte(`#!/bin/sh +echo This image is not meant to be run by itself +`) + +func testExtendedTestdataHelloBuilderScriptsRunBytes() ([]byte, error) { + return _testExtendedTestdataHelloBuilderScriptsRun, nil +} + +func testExtendedTestdataHelloBuilderScriptsRun() (*asset, error) { + bytes, err := testExtendedTestdataHelloBuilderScriptsRunBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/hello-builder/scripts/run", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataIdlingEchoServerRcYaml = []byte(`apiVersion: v1 +kind: List +items: +- apiVersion: v1 + kind: ReplicationController + metadata: + name: idling-echo-rc + spec: + replicas: 2 + selector: + app: idling-echo + replicationcontroller: idling-echo + template: + metadata: + labels: + app: idling-echo + replicationcontroller: idling-echo + spec: + containers: + - image: openshift/origin-base + name: idling-echo + command: + - /usr/bin/socat + - TCP4-LISTEN:8675,reuseaddr,fork + - EXEC:'/bin/cat' + ports: + - containerPort: 8675 + protocol: TCP + dnsPolicy: ClusterFirst + restartPolicy: Always + securityContext: {} +- apiVersion: v1 + kind: Service + metadata: + name: idling-echo + spec: + selector: + app: idling-echo + ports: + - port: 8675 +- apiVersion: v1 + kind: Route + metadata: + name: idling-echo + spec: + to: + kind: Service + name: idling-echo + +`) + +func testExtendedTestdataIdlingEchoServerRcYamlBytes() ([]byte, error) { + return _testExtendedTestdataIdlingEchoServerRcYaml, nil +} + +func testExtendedTestdataIdlingEchoServerRcYaml() (*asset, error) { + bytes, err := testExtendedTestdataIdlingEchoServerRcYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/idling-echo-server-rc.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataIdlingEchoServerYaml = []byte(`apiVersion: v1 +kind: List +metadata: {} +items: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + name: idling-echo + spec: + replicas: 2 + selector: + app: idling-echo + deploymentconfig: idling-echo + strategy: + type: Rolling + template: + metadata: + labels: + app: idling-echo + deploymentconfig: idling-echo + spec: + containers: + - image: openshift/origin-base + name: idling-tcp-echo + command: + - /usr/bin/socat + - TCP4-LISTEN:8675,reuseaddr,fork + - EXEC:'/bin/cat' + ports: + - containerPort: 8675 + protocol: TCP + - image: openshift/origin-base + name: idling-udp-echo + command: + - /usr/bin/socat + - UDP4-LISTEN:3090,reuseaddr,fork + - EXEC:'/bin/cat' + ports: + - containerPort: 3090 + protocol: UDP + dnsPolicy: ClusterFirst + restartPolicy: Always + securityContext: {} +- apiVersion: v1 + kind: Service + metadata: + name: idling-echo + labels: + app: idling-echo + spec: + selector: + app: idling-echo + ports: + - port: 8675 + name: tcp-echo + protocol: TCP + - port: 3090 + name: udp-echo + protocol: UDP +- apiVersion: v1 + kind: Route + metadata: + name: idling-echo + spec: + to: + kind: Service + name: idling-echo +- apiVersion: v1 + kind: Route + metadata: + name: idling-echo-reencrypt + spec: + tls: + termination: reencrypt + # the actual certificate here is not relevant, since we're not + # actually serving TLS + destinationCACertificate: |- + -----BEGIN CERTIFICATE----- + MIIDIjCCAgqgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBoTELMAkGA1UEBhMCVVMx + CzAJBgNVBAgMAlNDMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0Rl + ZmF1bHQgQ29tcGFueSBMdGQxEDAOBgNVBAsMB1Rlc3QgQ0ExGjAYBgNVBAMMEXd3 + dy5leGFtcGxlY2EuY29tMSIwIAYJKoZIhvcNAQkBFhNleGFtcGxlQGV4YW1wbGUu + Y29tMB4XDTE1MDExMjE0MTk0MVoXDTE2MDExMjE0MTk0MVowfDEYMBYGA1UEAwwP + d3d3LmV4YW1wbGUuY29tMQswCQYDVQQIDAJTQzELMAkGA1UEBhMCVVMxIjAgBgkq + hkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5jb20xEDAOBgNVBAoMB0V4YW1wbGUx + EDAOBgNVBAsMB0V4YW1wbGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMrv + gu6ZTTefNN7jjiZbS/xvQjyXjYMN7oVXv76jbX8gjMOmg9m0xoVZZFAE4XyQDuCm + 47VRx5Qrf/YLXmB2VtCFvB0AhXr5zSeWzPwaAPrjA4ebG+LUo24ziS8KqNxrFs1M + mNrQUgZyQC6XIe1JHXc9t+JlL5UZyZQC1IfaJulDAgMBAAGjDTALMAkGA1UdEwQC + MAAwDQYJKoZIhvcNAQEFBQADggEBAFCi7ZlkMnESvzlZCvv82Pq6S46AAOTPXdFd + TMvrh12E1sdVALF1P1oYFJzG1EiZ5ezOx88fEDTW+Lxb9anw5/KJzwtWcfsupf1m + V7J0D3qKzw5C1wjzYHh9/Pz7B1D0KthQRATQCfNf8s6bbFLaw/dmiIUhHLtIH5Qc + yfrejTZbOSP77z8NOWir+BWWgIDDB2//3AkDIQvT20vmkZRhkqSdT7et4NmXOX/j + jhPti4b2Fie0LeuvgaOdKjCpQQNrYthZHXeVlOLRhMTSk3qUczenkKTOhvP7IS9q + +Dzv5hqgSfvMG392KWh5f8xXfJNs4W5KLbZyl901MeReiLrPH3w= + -----END CERTIFICATE----- + to: + kind: Service + name: idling-echo +`) + +func testExtendedTestdataIdlingEchoServerYamlBytes() ([]byte, error) { + return _testExtendedTestdataIdlingEchoServerYaml, nil +} + +func testExtendedTestdataIdlingEchoServerYaml() (*asset, error) { + bytes, err := testExtendedTestdataIdlingEchoServerYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/idling-echo-server.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataImagePullSecretsDcWithNewPullSecretYaml = []byte(`kind: Template +apiVersion: v1 +metadata: + name: template +objects: +- kind: DeploymentConfig + apiVersion: v1 + metadata: + name: my-dc + spec: + replicas: 1 + selector: + deploymentconfig: my-dc + strategy: + type: Rolling + rollingParams: + pre: + failurePolicy: Abort + execNewPod: + containerName: dc-pod + command: + - ls + template: + metadata: + labels: + deploymentconfig: my-dc + spec: + containers: + - name: dc-pod + image: ${DOCKER_REGISTRY}/image-ns/busybox + imagePullSecrets: + - name: image-ns-pull +parameters: +- name: DOCKER_REGISTRY`) + +func testExtendedTestdataImagePullSecretsDcWithNewPullSecretYamlBytes() ([]byte, error) { + return _testExtendedTestdataImagePullSecretsDcWithNewPullSecretYaml, nil +} + +func testExtendedTestdataImagePullSecretsDcWithNewPullSecretYaml() (*asset, error) { + bytes, err := testExtendedTestdataImagePullSecretsDcWithNewPullSecretYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/image-pull-secrets/dc-with-new-pull-secret.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataImagePullSecretsDcWithOldPullSecretYaml = []byte(`kind: Template +apiVersion: v1 +metadata: + name: template +objects: +- kind: DeploymentConfig + apiVersion: v1 + metadata: + name: my-dc-old + spec: + replicas: 1 + selector: + deploymentconfig: my-dc-old + strategy: + type: Rolling + rollingParams: + pre: + failurePolicy: Abort + execNewPod: + containerName: dc-pod-old + command: + - ls + template: + metadata: + labels: + deploymentconfig: my-dc-old + spec: + containers: + - name: dc-pod-old + image: ${DOCKER_REGISTRY}/image-ns/busybox + imagePullSecrets: + - name: image-ns-pull-old +parameters: +- name: DOCKER_REGISTRY`) + +func testExtendedTestdataImagePullSecretsDcWithOldPullSecretYamlBytes() ([]byte, error) { + return _testExtendedTestdataImagePullSecretsDcWithOldPullSecretYaml, nil +} + +func testExtendedTestdataImagePullSecretsDcWithOldPullSecretYaml() (*asset, error) { + bytes, err := testExtendedTestdataImagePullSecretsDcWithOldPullSecretYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/image-pull-secrets/dc-with-old-pull-secret.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataImagePullSecretsPodWithNewPullSecretYaml = []byte(`kind: Template +apiVersion: v1 +metadata: + name: template +objects: +- kind: Pod + apiVersion: v1 + metadata: + name: new-pull-pod + spec: + containers: + - name: new-pull-pod + image: ${DOCKER_REGISTRY}/image-ns/busybox + command: + - ls + imagePullSecrets: + - name: image-ns-pull +parameters: +- name: DOCKER_REGISTRY`) + +func testExtendedTestdataImagePullSecretsPodWithNewPullSecretYamlBytes() ([]byte, error) { + return _testExtendedTestdataImagePullSecretsPodWithNewPullSecretYaml, nil +} + +func testExtendedTestdataImagePullSecretsPodWithNewPullSecretYaml() (*asset, error) { + bytes, err := testExtendedTestdataImagePullSecretsPodWithNewPullSecretYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/image-pull-secrets/pod-with-new-pull-secret.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataImagePullSecretsPodWithNoPullSecretYaml = []byte(`kind: Template +apiVersion: v1 +metadata: + name: template +objects: +- kind: Pod + apiVersion: v1 + metadata: + name: no-pull-pod + spec: + containers: + - name: no-pull-pod + image: ${DOCKER_REGISTRY}/image-ns/busybox + command: + - ls +parameters: +- name: DOCKER_REGISTRY`) + +func testExtendedTestdataImagePullSecretsPodWithNoPullSecretYamlBytes() ([]byte, error) { + return _testExtendedTestdataImagePullSecretsPodWithNoPullSecretYaml, nil +} + +func testExtendedTestdataImagePullSecretsPodWithNoPullSecretYaml() (*asset, error) { + bytes, err := testExtendedTestdataImagePullSecretsPodWithNoPullSecretYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/image-pull-secrets/pod-with-no-pull-secret.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataImagePullSecretsPodWithOldPullSecretYaml = []byte(`kind: Template +apiVersion: v1 +metadata: + name: template +objects: +- kind: Pod + apiVersion: v1 + metadata: + name: old-pull-pod + spec: + containers: + - name: old-pull-pod + image: ${DOCKER_REGISTRY}/image-ns/busybox + command: + - ls + imagePullSecrets: + - name: image-ns-pull-old +parameters: +- name: DOCKER_REGISTRY`) + +func testExtendedTestdataImagePullSecretsPodWithOldPullSecretYamlBytes() ([]byte, error) { + return _testExtendedTestdataImagePullSecretsPodWithOldPullSecretYaml, nil +} + +func testExtendedTestdataImagePullSecretsPodWithOldPullSecretYaml() (*asset, error) { + bytes, err := testExtendedTestdataImagePullSecretsPodWithOldPullSecretYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/image-pull-secrets/pod-with-old-pull-secret.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataIncrementalAuthBuildJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "push-pull-builder", + "creationTimestamp": null, + "annotations": { + "description": "This defines a build which pulls from and pushes to the internal registry", + "iconClass": "icon-ruby", + "tags": "instant-app,ruby,mysql" + } + }, + "objects": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "internal-image", + "creationTimestamp": null + }, + "spec": {} + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "initial-build", + "creationTimestamp": null, + "labels": { + "name": "initial-build" + } + }, + "spec": { + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/bparees/incremental-app.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7:latest" + } + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "internal-image:latest" + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "internal-build", + "creationTimestamp": null, + "labels": { + "name": "internal-build" + } + }, + "spec": { + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/bparees/incremental-app.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ], + "from": { + "kind": "ImageStreamTag", + "name": "internal-image:latest" + }, + "incremental": true + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "internal-image:latest" + } + } + } + } + ], + "parameters": [], + "labels": { + "template": "application-template-stibuild" + } +}`) + +func testExtendedTestdataIncrementalAuthBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataIncrementalAuthBuildJson, nil +} + +func testExtendedTestdataIncrementalAuthBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataIncrementalAuthBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/incremental-auth-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginBuildJobCloneXml = []byte(` + + + + false + + + + + + + + + + + + + + true + + + +`) + +func testExtendedTestdataJenkinsPluginBuildJobCloneXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginBuildJobCloneXml, nil +} + +func testExtendedTestdataJenkinsPluginBuildJobCloneXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginBuildJobCloneXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/build-job-clone.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginBuildJobSlaveXml = []byte(` + + + + false + + + nodejs + false + false + false + false + + false + + + + https://openshift.default.svc.cluster.local + frontend + ${PROJECT_NAME} + 0 + + + + + https://openshift.default.svc.cluster.local + frontend + ${PROJECT_NAME} + + true + true + + + + + ${PROJECT_NAME} + + false + + sec + frontend + + + + https://openshift.default.svc.cluster.local + frontend + ${PROJECT_NAME} + + + + + https://openshift.default.svc.cluster.local + ${PROJECT_NAME} + origin-nodejs-sample + latest + origin-nodejs-sample + prod + + + + + https://openshift.default.svc.cluster.local + frontend-prod + ${PROJECT_NAME} + 0 + + + + + + + +`) + +func testExtendedTestdataJenkinsPluginBuildJobSlaveXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginBuildJobSlaveXml, nil +} + +func testExtendedTestdataJenkinsPluginBuildJobSlaveXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginBuildJobSlaveXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/build-job-slave.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginBuildJobXml = []byte(` + + + + false + + true + false + false + false + + false + + + + https://openshift.default.svc.cluster.local + frontend + ${PROJECT_NAME} + 0 + + + + + https://openshift.default.svc.cluster.local + frontend + ${PROJECT_NAME} + + true + true + + + + + ${PROJECT_NAME} + + false + + sec + frontend + + + + https://openshift.default.svc.cluster.local + frontend + ${PROJECT_NAME} + + + + + https://openshift.default.svc.cluster.local + ${PROJECT_NAME} + origin-nodejs-sample + latest + origin-nodejs-sample + prod + + + + + https://openshift.default.svc.cluster.local + frontend-prod + ${PROJECT_NAME} + 0 + + + + + + + +`) + +func testExtendedTestdataJenkinsPluginBuildJobXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginBuildJobXml, nil +} + +func testExtendedTestdataJenkinsPluginBuildJobXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginBuildJobXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/build-job.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginBuildWithEnvJobXml = []byte(` + + + + false + + true + false + false + false + + false + + + + https://openshift.default.svc.cluster.local + frontend + ${PROJECT_NAME} + + true + false + + + + a + b + + + C + D + + + e + + + + + + + + + + +`) + +func testExtendedTestdataJenkinsPluginBuildWithEnvJobXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginBuildWithEnvJobXml, nil +} + +func testExtendedTestdataJenkinsPluginBuildWithEnvJobXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginBuildWithEnvJobXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/build-with-env-job.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginBuildWithExecStepsXml = []byte(` + + + + false + + + + + + + + + + + true + false + false + false + + false + + + + ${PROJECT_NAME} + + true + 120000 + milli + ${POD_NAME} + ${CONTAINER_NAME} + echo + + + + ${PROJECT_NAME} + + true + 120000 + milli + ${POD_NAME} + ${CONTAINER_NAME} + echo + + + hello + + + world + + + 1 + + + + + + +`) + +func testExtendedTestdataJenkinsPluginBuildWithExecStepsXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginBuildWithExecStepsXml, nil +} + +func testExtendedTestdataJenkinsPluginBuildWithExecStepsXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginBuildWithExecStepsXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/build-with-exec-steps.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginCreateJobXml = []byte(` + + + + false + + true + false + false + false + + false + + + + ${PROJECT_NAME} + { + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "forcepull-extended-test-builder", + "labels": { + "foo": "bar" + }, + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "forcepull-bldr", + "creationTimestamp": null, + "labels": { + "foo": "bar" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/gabemontero/forcepull-extended-test-builder.git" + } + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "nocache": true + } + }, + "output":{ + "to":{ + "kind":"ImageStreamTag", + "name":"forcepull-extended-test-builder:latest" + } + } + } + } + ] +} + + + + + + + +`) + +func testExtendedTestdataJenkinsPluginCreateJobXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginCreateJobXml, nil +} + +func testExtendedTestdataJenkinsPluginCreateJobXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginCreateJobXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/create-job.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginDeleteJobKeysXml = []byte(` + + + + false + + true + false + false + false + + false + + + + ${PROJECT_NAME} + is,bc + forcepull-extended-test-builder,forcepull-bldr + + + + + + +`) + +func testExtendedTestdataJenkinsPluginDeleteJobKeysXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginDeleteJobKeysXml, nil +} + +func testExtendedTestdataJenkinsPluginDeleteJobKeysXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginDeleteJobKeysXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/delete-job-keys.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginDeleteJobLabelsXml = []byte(` + + + + false + + true + false + false + false + + false + + + + ${PROJECT_NAME} + bc,is + foo + bar + + + + + + +`) + +func testExtendedTestdataJenkinsPluginDeleteJobLabelsXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginDeleteJobLabelsXml, nil +} + +func testExtendedTestdataJenkinsPluginDeleteJobLabelsXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginDeleteJobLabelsXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/delete-job-labels.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginDeleteJobXml = []byte(` + + + + false + + true + false + false + false + + false + + + + ${PROJECT_NAME} + { + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "forcepull-extended-test-builder", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "forcepull-bldr", + "creationTimestamp": null, + "labels": { + "name": "forcepull-bldr" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/gabemontero/forcepull-extended-test-builder.git" + } + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "nocache": true + } + }, + "output":{ + "to":{ + "kind":"ImageStreamTag", + "name":"forcepull-extended-test-builder:latest" + } + } + } + } + ] +} + + + + + + + +`) + +func testExtendedTestdataJenkinsPluginDeleteJobXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginDeleteJobXml, nil +} + +func testExtendedTestdataJenkinsPluginDeleteJobXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginDeleteJobXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/delete-job.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginImagestreamScmDslJobXml = []byte(` + + + + false + + + + + + + + + + + + true + + + + * * * * * + false + + + +`) + +func testExtendedTestdataJenkinsPluginImagestreamScmDslJobXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginImagestreamScmDslJobXml, nil +} + +func testExtendedTestdataJenkinsPluginImagestreamScmDslJobXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginImagestreamScmDslJobXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/imagestream-scm-dsl-job.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginImagestreamScmJobXml = []byte(` + + + + false + + + + + + + + + + + testimage + v1 + + ${PROJECT_NAME} + + + true + false + false + false + + + * * * * * + false + + + false + + + + openshift + + false + latest + develop + jenkins + localjenkins + ${PROJECT_NAME} + + false + + + + + +`) + +func testExtendedTestdataJenkinsPluginImagestreamScmJobXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginImagestreamScmJobXml, nil +} + +func testExtendedTestdataJenkinsPluginImagestreamScmJobXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginImagestreamScmJobXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/imagestream-scm-job.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginMultitagJobXml = []byte(` + + + + false + + true + false + false + false + + false + + + + + https://openshift.default.svc.cluster.local + ${PROJECT_NAME} + multitag + orig + multitag + prod + + + + + + https://openshift.default.svc.cluster.local + ${PROJECT_NAME} + multitag + prod + multitag + prod2,prod3,prod4 + + + + + + https://openshift.default.svc.cluster.local + ${PROJECT_NAME} + multitag + prod4 + multitag, multitag2, multitag3 + prod5 + + + + + + https://openshift.default.svc.cluster.local + ${PROJECT_NAME} + multitag3 + prod5 + multitag, multitag2, multitag3 + prod6, prod7, prod8 + + + + + + https://openshift.default.svc.cluster.local + ${PROJECT_NAME} + multitag3 + prod8 + multitag4, multitag5, multitag6 + prod9, prod10, prod11 + + + + + + + +`) + +func testExtendedTestdataJenkinsPluginMultitagJobXmlBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginMultitagJobXml, nil +} + +func testExtendedTestdataJenkinsPluginMultitagJobXml() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginMultitagJobXmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/multitag-job.xml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginMultitagTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "multitag", + "creationTimestamp": null + }, + "objects": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "multitag" + }, + "spec": { + "tags": [ + { + "name": "orig", + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "multitag2" + }, + "spec": { + "tags": [ + { + "name": "orig", + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "multitag3" + }, + "spec": { + "tags": [ + { + "name": "orig", + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + ] + } + } + ] +} +`) + +func testExtendedTestdataJenkinsPluginMultitagTemplateJsonBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginMultitagTemplateJson, nil +} + +func testExtendedTestdataJenkinsPluginMultitagTemplateJson() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginMultitagTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/multitag-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJenkinsPluginSharedResourcesTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "nodejs-helloworld-sample", + "annotations": { + "description": "This example shows how to create a simple nodejs application in openshift origin v3", + "iconClass": "icon-nodejs", + "tags": "instant-app,nodejs" + } + }, + "objects": [ + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend-prod" + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 8080, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend-prod" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "frontend" + }, + "spec": { + "to": { + "kind": "Service", + "name": "frontend" + }, + "tls": { + "termination": "edge" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend-prod" + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 120 + } + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "nodejs-helloworld" + ], + "from": { + "kind": "ImageStreamTag", + "name": "origin-nodejs-sample:prod" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name":"frontend-prod" + }, + "template": { + "metadata": { + "labels": { + "name": "frontend-prod" + } + }, + "spec": { + "containers": [ + { + "name": "nodejs-helloworld", + "image": " ", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + } + }, + + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend" + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 8080, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-nodejs-sample" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-nodejs-sample2" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-nodejs-sample3" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "nodejs-010-centos7" + }, + "spec": { + "dockerImageRepository": "${NAMESPACE}/nodejs-010-centos7" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "labels": { + "name": "nodejs-sample-build" + } + }, + "spec": { + "triggers": [ + { + "type": "GitHub", + "github": { + "secret": "secret101" + } + }, + { + "type": "Generic", + "generic": { + "secret": "secret101" + } + } + ], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/nodejs-ex.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "nodejs-010-centos7:latest" + } + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-nodejs-sample:latest" + } + }, + "resources": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend" + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 120 + } + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "nodejs-helloworld" + ], + "from": { + "kind": "ImageStreamTag", + "name": "origin-nodejs-sample:latest" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name":"frontend" + }, + "template": { + "metadata": { + "labels": { + "name": "frontend" + } + }, + "spec": { + "containers": [ + { + "name": "nodejs-helloworld", + "image": " ", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + } + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi" + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "ADMIN_USERNAME", + "displayName": "Administrator Username", + "description": "Username for the administrator of this application.", + "generate": "expression", + "from": "admin[A-Z0-9]{3}" + }, + { + "name": "ADMIN_PASSWORD", + "displayName": "Administrator Password", + "description": "Password for the administrator of this application.", + "generate": "expression", + "from": "[a-zA-Z0-9]{8}" + } + ], + "labels": { + "template": "application-template-stibuild" + } +} +`) + +func testExtendedTestdataJenkinsPluginSharedResourcesTemplateJsonBytes() ([]byte, error) { + return _testExtendedTestdataJenkinsPluginSharedResourcesTemplateJson, nil +} + +func testExtendedTestdataJenkinsPluginSharedResourcesTemplateJson() (*asset, error) { + bytes, err := testExtendedTestdataJenkinsPluginSharedResourcesTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jenkins-plugin/shared-resources-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJobsV1Yaml = []byte(`apiVersion: batch/v1 +kind: Job +metadata: + name: simplev1 +spec: + template: + metadata: + name: simplev1 + labels: + app: simplev1 + spec: + containers: + - name: simplev1 + image: gcr.io/google_containers/busybox + command: ["/bin/sh", "-c", "exit 0"] + restartPolicy: Never +`) + +func testExtendedTestdataJobsV1YamlBytes() ([]byte, error) { + return _testExtendedTestdataJobsV1Yaml, nil +} + +func testExtendedTestdataJobsV1Yaml() (*asset, error) { + bytes, err := testExtendedTestdataJobsV1YamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jobs/v1.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataJobsV1beta1Yaml = []byte(`apiVersion: extensions/v1beta1 +kind: Job +metadata: + name: simplev1beta1 +spec: + template: + metadata: + name: simplev1beta1 + labels: + app: simplev1beta1 + spec: + containers: + - name: simplev1beta1 + image: gcr.io/google_containers/busybox + command: ["/bin/sh", "-c", "exit 0"] + restartPolicy: Never +`) + +func testExtendedTestdataJobsV1beta1YamlBytes() ([]byte, error) { + return _testExtendedTestdataJobsV1beta1Yaml, nil +} + +func testExtendedTestdataJobsV1beta1Yaml() (*asset, error) { + bytes, err := testExtendedTestdataJobsV1beta1YamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/jobs/v1beta1.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataLdapLdapserverBuildconfigJson = []byte(`{ + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "openldap", + "creationTimestamp": null, + "labels": { + "name": "openldap" + } + }, + "spec": { + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/origin.git", + "ref": "master" + }, + "contextDir": "images/openldap" + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "openldap:latest" + } + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "openldap-testenv:latest" + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } +}`) + +func testExtendedTestdataLdapLdapserverBuildconfigJsonBytes() ([]byte, error) { + return _testExtendedTestdataLdapLdapserverBuildconfigJson, nil +} + +func testExtendedTestdataLdapLdapserverBuildconfigJson() (*asset, error) { + bytes, err := testExtendedTestdataLdapLdapserverBuildconfigJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/ldap/ldapserver-buildconfig.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataLdapLdapserverDeploymentconfigJson = []byte(`{ + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "openldap-server", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate", + "resources": {} + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "openldap-server" + ], + "from": { + "kind": "ImageStreamTag", + "name": "openldap-testenv:latest" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "openldap-server" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "openldap-server" + } + }, + "spec": { + "containers": [ + { + "name": "openldap-server", + "image": "openldap-testenv", + "ports": [ + { + "containerPort": 389, + "protocol": "TCP" + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + }, + "readinessProbe": { + "exec": { + "command": ["ldapsearch", "-x", "-b", "dc=example,dc=com"] + }, + "initialDelaySeconds": 5, + "timeoutSeconds": 1 + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst", + "serviceAccount": "" + } + } + }, + "status": {} +}`) + +func testExtendedTestdataLdapLdapserverDeploymentconfigJsonBytes() ([]byte, error) { + return _testExtendedTestdataLdapLdapserverDeploymentconfigJson, nil +} + +func testExtendedTestdataLdapLdapserverDeploymentconfigJson() (*asset, error) { + bytes, err := testExtendedTestdataLdapLdapserverDeploymentconfigJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/ldap/ldapserver-deploymentconfig.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataLdapLdapserverImagestreamTestenvJson = []byte(`{ + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "openldap-testenv", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } +}`) + +func testExtendedTestdataLdapLdapserverImagestreamTestenvJsonBytes() ([]byte, error) { + return _testExtendedTestdataLdapLdapserverImagestreamTestenvJson, nil +} + +func testExtendedTestdataLdapLdapserverImagestreamTestenvJson() (*asset, error) { + bytes, err := testExtendedTestdataLdapLdapserverImagestreamTestenvJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/ldap/ldapserver-imagestream-testenv.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataLdapLdapserverImagestreamJson = []byte(`{ + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "openldap", + "creationTimestamp": null + }, + "spec": { + "dockerImageRepository": "openshift/openldap-2441-centos7", + "tags": [ + { + "tag": "latest", + "annotations": { + "description": "Provides OpenLDAP v2.4.41", + "iconClass": "fa-server", + "tags": "server,openldap", + "version": "2.4.41" + } + } + ] + }, + "status": { + "dockerImageRepository": "" + } +}`) + +func testExtendedTestdataLdapLdapserverImagestreamJsonBytes() ([]byte, error) { + return _testExtendedTestdataLdapLdapserverImagestreamJson, nil +} + +func testExtendedTestdataLdapLdapserverImagestreamJson() (*asset, error) { + bytes, err := testExtendedTestdataLdapLdapserverImagestreamJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/ldap/ldapserver-imagestream.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataLdapLdapserverServiceJson = []byte(`{ + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "openldap-server", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "ldap", + "protocol": "TCP", + "port": 389, + "targetPort": 389, + "nodePort": 0 + } + ], + "selector": { + "name": "openldap-server" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } +}`) + +func testExtendedTestdataLdapLdapserverServiceJsonBytes() ([]byte, error) { + return _testExtendedTestdataLdapLdapserverServiceJson, nil +} + +func testExtendedTestdataLdapLdapserverServiceJson() (*asset, error) { + bytes, err := testExtendedTestdataLdapLdapserverServiceJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/ldap/ldapserver-service.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataLong_namesDockerfile = []byte(`FROM centos/ruby-22-centos7 + +CMD ["/bin/sh", "-c", "echo", "hello"] +`) + +func testExtendedTestdataLong_namesDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataLong_namesDockerfile, nil +} + +func testExtendedTestdataLong_namesDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataLong_namesDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/long_names/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataLong_namesFixtureJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890a", + "labels": { + "name": "12345678901234567890123456789012345678901234567890123456789012a" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "env": [], + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + } + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890b", + "labels": { + "name": "12345678901234567890123456789012345678901234567890123456789012b" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "env": [], + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + } + } + } + ] +}`) + +func testExtendedTestdataLong_namesFixtureJsonBytes() ([]byte, error) { + return _testExtendedTestdataLong_namesFixtureJson, nil +} + +func testExtendedTestdataLong_namesFixtureJson() (*asset, error) { + bytes, err := testExtendedTestdataLong_namesFixtureJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/long_names/fixture.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataRolesEmptyRoleYaml = []byte(`apiVersion: v1 +kind: Role +metadata: + name: empty-role +`) + +func testExtendedTestdataRolesEmptyRoleYamlBytes() ([]byte, error) { + return _testExtendedTestdataRolesEmptyRoleYaml, nil +} + +func testExtendedTestdataRolesEmptyRoleYaml() (*asset, error) { + bytes, err := testExtendedTestdataRolesEmptyRoleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/roles/empty-role.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataRolesPolicyClusterrolesYaml = []byte(`apiVersion: v1 +items: +- apiVersion: v1 + kind: ClusterRole + metadata: + creationTimestamp: null + name: basic-user2 + rules: + - apiGroups: null + attributeRestrictions: null + resourceNames: + - "~" + resources: + - users + verbs: + - get + - apiGroups: null + attributeRestrictions: null + resources: + - projectrequests + verbs: + - list + - apiGroups: null + attributeRestrictions: null + resources: + - clusterroles + verbs: + - get + - list + - apiGroups: null + attributeRestrictions: null + resources: + - projects + verbs: + - list + - apiGroups: null + attributeRestrictions: + apiVersion: v1 + kind: IsPersonalSubjectAccessReview + resources: + - localsubjectaccessreviews + - subjectaccessreviews + verbs: + - create +- apiVersion: v1 + groupNames: + - system:authenticated + kind: ClusterRoleBinding + metadata: + creationTimestamp: null + name: basic-users2 + roleRef: + name: basic-user2 + subjects: + - kind: SystemGroup + name: system:authenticated + userNames: null +kind: List +metadata: {} +`) + +func testExtendedTestdataRolesPolicyClusterrolesYamlBytes() ([]byte, error) { + return _testExtendedTestdataRolesPolicyClusterrolesYaml, nil +} + +func testExtendedTestdataRolesPolicyClusterrolesYaml() (*asset, error) { + bytes, err := testExtendedTestdataRolesPolicyClusterrolesYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/roles/policy-clusterroles.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataRolesPolicyRolesYaml = []byte(`kind: Template +apiVersion: v1 +metadata: + name: "policy-roles-template" +labels: + createdBy: "policy-roles-template" +parameters: + - description: "The namespace to create roles in." + name: NAMESPACE + required: true +objects: + - apiVersion: v1 + kind: Role + metadata: + creationTimestamp: null + name: basic-user + rules: + - apiGroups: null + attributeRestrictions: null + resourceNames: + - "~" + resources: + - users + verbs: + - get + - apiGroups: null + attributeRestrictions: null + resources: + - projectrequests + verbs: + - list + - apiGroups: null + attributeRestrictions: null + resources: + - clusterroles + verbs: + - get + - list + - apiGroups: null + attributeRestrictions: null + resources: + - projects + verbs: + - list + - apiGroups: null + attributeRestrictions: + apiVersion: v1 + kind: IsPersonalSubjectAccessReview + resources: + - localsubjectaccessreviews + - subjectaccessreviews + verbs: + - create + - apiVersion: v1 + groupNames: + - system:authenticated + kind: PolicyBinding + metadata: + name: "${NAMESPACE}:default" + policyRef: + namespace: ${NAMESPACE} + - apiVersion: v1 + groupNames: + - system:authenticated + kind: RoleBinding + metadata: + creationTimestamp: null + name: basic-users + roleRef: + name: basic-user + namespace: ${NAMESPACE} + subjects: + - kind: SystemGroup + name: system:authenticated + userNames: null`) + +func testExtendedTestdataRolesPolicyRolesYamlBytes() ([]byte, error) { + return _testExtendedTestdataRolesPolicyRolesYaml, nil +} + +func testExtendedTestdataRolesPolicyRolesYaml() (*asset, error) { + bytes, err := testExtendedTestdataRolesPolicyRolesYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/roles/policy-roles.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataRun_policyParallelBcYaml = []byte(`--- + kind: "List" + apiVersion: "v1" + metadata: {} + items: + - + kind: "ImageStream" + apiVersion: "v1" + metadata: + name: "origin-ruby-sample" + creationTimestamp: null + spec: {} + status: + dockerImageRepository: "" + - + kind: "BuildConfig" + apiVersion: "v1" + metadata: + name: "sample-parallel-build" + spec: + runPolicy: "Parallel" + triggers: + - + type: "imageChange" + imageChange: {} + source: + type: "Git" + git: + uri: "git://github.com/openshift/ruby-hello-world.git" + strategy: + type: "Source" + sourceStrategy: + from: + kind: "DockerImage" + name: "centos/ruby-22-centos7" + resources: {} + status: + lastVersion: 0 + +`) + +func testExtendedTestdataRun_policyParallelBcYamlBytes() ([]byte, error) { + return _testExtendedTestdataRun_policyParallelBcYaml, nil +} + +func testExtendedTestdataRun_policyParallelBcYaml() (*asset, error) { + bytes, err := testExtendedTestdataRun_policyParallelBcYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/run_policy/parallel-bc.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataRun_policySerialBcYaml = []byte(`--- + kind: "List" + apiVersion: "v1" + metadata: {} + items: + - + kind: "BuildConfig" + apiVersion: "v1" + metadata: + name: "sample-serial-build" + spec: + runPolicy: "Serial" + triggers: + - + type: "imageChange" + imageChange: {} + source: + type: "Git" + git: + uri: "git://github.com/openshift/ruby-hello-world.git" + strategy: + type: "Source" + sourceStrategy: + from: + kind: "DockerImage" + name: "centos/ruby-22-centos7" + resources: {} + status: + lastVersion: 0 + +`) + +func testExtendedTestdataRun_policySerialBcYamlBytes() ([]byte, error) { + return _testExtendedTestdataRun_policySerialBcYaml, nil +} + +func testExtendedTestdataRun_policySerialBcYaml() (*asset, error) { + bytes, err := testExtendedTestdataRun_policySerialBcYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/run_policy/serial-bc.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataRun_policySerialLatestOnlyBcYaml = []byte(`--- + kind: "List" + apiVersion: "v1" + metadata: {} + items: + - + kind: "BuildConfig" + apiVersion: "v1" + metadata: + name: "sample-serial-latest-only-build" + spec: + runPolicy: "SerialLatestOnly" + triggers: + - + type: "imageChange" + imageChange: {} + source: + type: "Git" + git: + uri: "git://github.com/openshift/ruby-hello-world.git" + strategy: + type: "Source" + sourceStrategy: + from: + kind: "DockerImage" + name: "centos/ruby-22-centos7" + resources: {} + status: + lastVersion: 0 + +`) + +func testExtendedTestdataRun_policySerialLatestOnlyBcYamlBytes() ([]byte, error) { + return _testExtendedTestdataRun_policySerialLatestOnlyBcYaml, nil +} + +func testExtendedTestdataRun_policySerialLatestOnlyBcYaml() (*asset, error) { + bytes, err := testExtendedTestdataRun_policySerialLatestOnlyBcYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/run_policy/serial-latest-only-bc.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataS2iDropcapsRootAccessBuildYaml = []byte(`apiVersion: v1 +items: +- apiVersion: v1 + kind: BuildConfig + metadata: + labels: + build: root-access-build + name: root-access-build + spec: + output: + to: + kind: ImageStreamTag + name: root-access-build:latest + postCommit: {} + resources: {} + source: + git: + uri: https://github.com/openshift/ruby-hello-world.git + secrets: [] + type: Git + strategy: + sourceStrategy: + from: + kind: ImageStreamTag + name: rootable-ruby:latest + type: Source + triggers: [] +- apiVersion: v1 + kind: ImageStream + metadata: + labels: + build: root-access-build + name: root-access-build + spec: {} +kind: List +metadata: {} +`) + +func testExtendedTestdataS2iDropcapsRootAccessBuildYamlBytes() ([]byte, error) { + return _testExtendedTestdataS2iDropcapsRootAccessBuildYaml, nil +} + +func testExtendedTestdataS2iDropcapsRootAccessBuildYaml() (*asset, error) { + bytes, err := testExtendedTestdataS2iDropcapsRootAccessBuildYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/s2i-dropcaps/root-access-build.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataS2iDropcapsRootableRubyDockerfile = []byte(`FROM centos/ruby-22-centos7:latest +USER root +RUN yum -y install expect +RUN echo "root:redhat" | chpasswd +USER 1001 +COPY ./adduser /usr/libexec/s2i/ +COPY ./assemble /usr/libexec/s2i/ +`) + +func testExtendedTestdataS2iDropcapsRootableRubyDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataS2iDropcapsRootableRubyDockerfile, nil +} + +func testExtendedTestdataS2iDropcapsRootableRubyDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataS2iDropcapsRootableRubyDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/s2i-dropcaps/rootable-ruby/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataS2iDropcapsRootableRubyAdduser = []byte(`#!/usr/bin/expect + +spawn su +expect "Password:" { + send "redhat\r" +} + +expect "#" { + send "adduser mytestuser\r" +} + +expect "#" { + send "exit\r" +} + +expect "$" {} +`) + +func testExtendedTestdataS2iDropcapsRootableRubyAdduserBytes() ([]byte, error) { + return _testExtendedTestdataS2iDropcapsRootableRubyAdduser, nil +} + +func testExtendedTestdataS2iDropcapsRootableRubyAdduser() (*asset, error) { + bytes, err := testExtendedTestdataS2iDropcapsRootableRubyAdduserBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/s2i-dropcaps/rootable-ruby/adduser", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataS2iDropcapsRootableRubyAssemble = []byte(`#!/bin/bash +set -e +/usr/libexec/s2i/adduser +cat /etc/passwd +grep "mytestuser" /etc/passwd +`) + +func testExtendedTestdataS2iDropcapsRootableRubyAssembleBytes() ([]byte, error) { + return _testExtendedTestdataS2iDropcapsRootableRubyAssemble, nil +} + +func testExtendedTestdataS2iDropcapsRootableRubyAssemble() (*asset, error) { + bytes, err := testExtendedTestdataS2iDropcapsRootableRubyAssembleBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/s2i-dropcaps/rootable-ruby/assemble", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataSampleImageStreamJson = []byte(`{ + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "samplerepository", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } +}`) + +func testExtendedTestdataSampleImageStreamJsonBytes() ([]byte, error) { + return _testExtendedTestdataSampleImageStreamJson, nil +} + +func testExtendedTestdataSampleImageStreamJson() (*asset, error) { + bytes, err := testExtendedTestdataSampleImageStreamJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/sample-image-stream.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataScopedRouterYaml = []byte(`apiVersion: v1 +kind: Template +parameters: +- name: IMAGE + value: openshift/origin-haproxy-router:latest +objects: +# a scoped router +- apiVersion: v1 + kind: Pod + metadata: + name: scoped-router + labels: + test: scoped-router + spec: + containers: + - name: router + image: ${IMAGE} + imagePullPolicy: IfNotPresent + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + args: ["--namespace=$(POD_NAMESPACE)", "--loglevel=4", "--labels=select=first"] + hostNetwork: false + ports: + - containerPort: 80 + - containerPort: 443 + - containerPort: 1936 + name: stats + protocol: TCP + serviceAccountName: default + +# a router that overrides host +- apiVersion: v1 + kind: Pod + metadata: + name: router-override + labels: + test: router-override + spec: + containers: + - name: router + image: ${IMAGE} + imagePullPolicy: IfNotPresent + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + args: ["--namespace=$(POD_NAMESPACE)", "--loglevel=4", "--override-hostname", "--hostname-template=${name}-${namespace}.myapps.mycompany.com"] + hostNetwork: false + ports: + - containerPort: 80 + - containerPort: 443 + - containerPort: 1936 + name: stats + protocol: TCP + serviceAccountName: default + + +# ensure the router can access routes and endpoints +- apiVersion: v1 + kind: RoleBinding + metadata: + name: system-router + subjects: + - kind: ServiceAccount + name: default + roleRef: + name: system:router + +# two routes that differ only by their labels and names +- apiVersion: v1 + kind: Route + metadata: + name: route-1 + labels: + test: router + select: first + spec: + host: first.example.com + to: + name: endpoints + ports: + - targetPort: 8080 +- apiVersion: v1 + kind: Route + metadata: + name: route-2 + labels: + test: router + select: second + spec: + host: second.example.com + to: + name: endpoints + ports: + - targetPort: http + +# a service to be routed to +- apiVersion: v1 + kind: Service + metadata: + name: endpoints + labels: + test: router + spec: + selector: + test: router + endpoints: router + ports: + - port: 8080 +# a pod that serves a response +- apiVersion: v1 + kind: Pod + metadata: + name: endpoint-1 + labels: + test: router + endpoints: router + spec: + containers: + - name: test + image: openshift/hello-openshift + # image: openshift/deployment-example:v1 + ports: + - containerPort: 8080 + name: http + - containerPort: 100 + protocol: UDP +`) + +func testExtendedTestdataScopedRouterYamlBytes() ([]byte, error) { + return _testExtendedTestdataScopedRouterYaml, nil +} + +func testExtendedTestdataScopedRouterYaml() (*asset, error) { + bytes, err := testExtendedTestdataScopedRouterYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/scoped-router.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataServiceServingCertNginxServingCertConf = []byte(`server { + listen 443; + + ssl on; + ssl_certificate /etc/serving-cert/tls.crt; + ssl_certificate_key /etc/serving-cert/tls.key; + server_name localhost; + + #charset koi8-r; + #access_log /var/log/nginx/log/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} +`) + +func testExtendedTestdataServiceServingCertNginxServingCertConfBytes() ([]byte, error) { + return _testExtendedTestdataServiceServingCertNginxServingCertConf, nil +} + +func testExtendedTestdataServiceServingCertNginxServingCertConf() (*asset, error) { + bytes, err := testExtendedTestdataServiceServingCertNginxServingCertConfBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/service-serving-cert/nginx-serving-cert.conf", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStatusfailAssembleS2iBinAssemble = []byte(`#!/usr/bin/env bash + +exit 123123 +`) + +func testExtendedTestdataStatusfailAssembleS2iBinAssembleBytes() ([]byte, error) { + return _testExtendedTestdataStatusfailAssembleS2iBinAssemble, nil +} + +func testExtendedTestdataStatusfailAssembleS2iBinAssemble() (*asset, error) { + bytes, err := testExtendedTestdataStatusfailAssembleS2iBinAssembleBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/statusfail-assemble/.s2i/bin/assemble", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStatusfailFailedassembleYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: statusfail-assemblescript +spec: + source: + type: binary + strategy: + type: Source + sourceStrategy: + from: + kind: DockerImage + name: centos/ruby-23-centos7:latest +`) + +func testExtendedTestdataStatusfailFailedassembleYamlBytes() ([]byte, error) { + return _testExtendedTestdataStatusfailFailedassembleYaml, nil +} + +func testExtendedTestdataStatusfailFailedassembleYaml() (*asset, error) { + bytes, err := testExtendedTestdataStatusfailFailedassembleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/statusfail-failedassemble.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStatusfailFetchbuilderimageYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: statusfail-builderimage +spec: + source: + git: + uri: "https://github.com/openshift/ruby-hello-world.git" + strategy: + type: Docker + dockerStrategy: + from: + kind: DockerImage + name: fail/me:latest +`) + +func testExtendedTestdataStatusfailFetchbuilderimageYamlBytes() ([]byte, error) { + return _testExtendedTestdataStatusfailFetchbuilderimageYaml, nil +} + +func testExtendedTestdataStatusfailFetchbuilderimageYaml() (*asset, error) { + bytes, err := testExtendedTestdataStatusfailFetchbuilderimageYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/statusfail-fetchbuilderimage.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStatusfailFetchsourcedockerYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: statusfail-fetchsourcedocker +spec: + source: + git: + uri: "https://failure/docker/status" + strategy: + type: Docker + dockerStrategy: + from: + kind: DockerImage + name: centos/ruby-23-centos7:latest +`) + +func testExtendedTestdataStatusfailFetchsourcedockerYamlBytes() ([]byte, error) { + return _testExtendedTestdataStatusfailFetchsourcedockerYaml, nil +} + +func testExtendedTestdataStatusfailFetchsourcedockerYaml() (*asset, error) { + bytes, err := testExtendedTestdataStatusfailFetchsourcedockerYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/statusfail-fetchsourcedocker.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStatusfailFetchsources2iYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: statusfail-fetchsourcesourcetoimage +spec: + source: + git: + uri: "https://failure/sourcetoimage/status" + strategy: + type: Source + sourceStrategy: + from: + kind: DockerImage + name: centos/ruby-23-centos7:latest +`) + +func testExtendedTestdataStatusfailFetchsources2iYamlBytes() ([]byte, error) { + return _testExtendedTestdataStatusfailFetchsources2iYaml, nil +} + +func testExtendedTestdataStatusfailFetchsources2iYaml() (*asset, error) { + bytes, err := testExtendedTestdataStatusfailFetchsources2iYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/statusfail-fetchsources2i.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStatusfailPostcommithookYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: statusfail-postcommithook +spec: + source: + git: + uri: "https://github.com/openshift/ruby-hello-world.git" + postCommit: + args: + - failme + strategy: + sourceStrategy: + from: + kind: DockerImage + name: centos/ruby-23-centos7:latest + type: Source +`) + +func testExtendedTestdataStatusfailPostcommithookYamlBytes() ([]byte, error) { + return _testExtendedTestdataStatusfailPostcommithookYaml, nil +} + +func testExtendedTestdataStatusfailPostcommithookYaml() (*asset, error) { + bytes, err := testExtendedTestdataStatusfailPostcommithookYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/statusfail-postcommithook.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStatusfailPushtoregistryYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: statusfail-pushtoregistry +spec: + source: + git: + uri: "https://github.com/openshift/ruby-hello-world.git" + output: + to: + kind: DockerImage + name: bogus.registry/image:latest + strategy: + sourceStrategy: + from: + kind: DockerImage + name: centos/ruby-23-centos7:latest + type: Source +`) + +func testExtendedTestdataStatusfailPushtoregistryYamlBytes() ([]byte, error) { + return _testExtendedTestdataStatusfailPushtoregistryYaml, nil +} + +func testExtendedTestdataStatusfailPushtoregistryYaml() (*asset, error) { + bytes, err := testExtendedTestdataStatusfailPushtoregistryYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/statusfail-pushtoregistry.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStatusfailRuntimeartifactsYaml = []byte(`kind: BuildConfig +apiVersion: v1 +metadata: + name: statusfail-runtimeartifacts +spec: + source: + git: + uri: "https://github.com/openshift/ruby-hello-world" + strategy: + sourceStrategy: + from: + kind: DockerImage + name: centos/ruby-23-centos7 + runtimeArtifacts: + - destinationDir: app + sourcePath: /tmp/failure + runtimeImage: + kind: DockerImage + name: centos/ruby-23-centos7 + type: Source +`) + +func testExtendedTestdataStatusfailRuntimeartifactsYamlBytes() ([]byte, error) { + return _testExtendedTestdataStatusfailRuntimeartifactsYaml, nil +} + +func testExtendedTestdataStatusfailRuntimeartifactsYaml() (*asset, error) { + bytes, err := testExtendedTestdataStatusfailRuntimeartifactsYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/statusfail-runtimeartifacts.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStiEnvironmentBuildAppStiEnvironment = []byte(`TEST_ENV=success +`) + +func testExtendedTestdataStiEnvironmentBuildAppStiEnvironmentBytes() ([]byte, error) { + return _testExtendedTestdataStiEnvironmentBuildAppStiEnvironment, nil +} + +func testExtendedTestdataStiEnvironmentBuildAppStiEnvironment() (*asset, error) { + bytes, err := testExtendedTestdataStiEnvironmentBuildAppStiEnvironmentBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/sti-environment-build-app/.sti/environment", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStiEnvironmentBuildAppGemfile = []byte(`source "https://rubygems.org" + +gem "rack" +`) + +func testExtendedTestdataStiEnvironmentBuildAppGemfileBytes() ([]byte, error) { + return _testExtendedTestdataStiEnvironmentBuildAppGemfile, nil +} + +func testExtendedTestdataStiEnvironmentBuildAppGemfile() (*asset, error) { + bytes, err := testExtendedTestdataStiEnvironmentBuildAppGemfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/sti-environment-build-app/Gemfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataStiEnvironmentBuildAppConfigRu = []byte(`run Proc.new {|env| [200, {"Content-Type" => "text/html"}, [ENV['TEST_ENV']]]} +`) + +func testExtendedTestdataStiEnvironmentBuildAppConfigRuBytes() ([]byte, error) { + return _testExtendedTestdataStiEnvironmentBuildAppConfigRu, nil +} + +func testExtendedTestdataStiEnvironmentBuildAppConfigRu() (*asset, error) { + bytes, err := testExtendedTestdataStiEnvironmentBuildAppConfigRuBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/sti-environment-build-app/config.ru", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestAuthBuildYaml = []byte(`apiVersion: v1 +kind: Template +labels: + template: gitserver +metadata: + name: gitserver +parameters: +- name: SOURCE_URL + required: true +- name: SOURCE_SECRET + required: true +objects: +- apiVersion: v1 + kind: BuildConfig + metadata: + name: gitauthtest + spec: + source: + git: + uri: ${SOURCE_URL} + type: Git + sourceSecret: + name: ${SOURCE_SECRET} + strategy: + sourceStrategy: + from: + kind: ImageStreamTag + name: ruby:latest + namespace: openshift + type: Source +`) + +func testExtendedTestdataTestAuthBuildYamlBytes() ([]byte, error) { + return _testExtendedTestdataTestAuthBuildYaml, nil +} + +func testExtendedTestdataTestAuthBuildYaml() (*asset, error) { + bytes, err := testExtendedTestdataTestAuthBuildYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-auth-build.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestBuildAppDockerfile = []byte(`FROM centos/ruby-22-centos7 +USER default +EXPOSE 8080 +ENV RACK_ENV production +ENV RAILS_ENV production +COPY . /opt/app-root/src/ +RUN scl enable rh-ruby22 "bundle install" +CMD ["scl", "enable", "rh-ruby22", "./run.sh"] + +USER default +`) + +func testExtendedTestdataTestBuildAppDockerfileBytes() ([]byte, error) { + return _testExtendedTestdataTestBuildAppDockerfile, nil +} + +func testExtendedTestdataTestBuildAppDockerfile() (*asset, error) { + bytes, err := testExtendedTestdataTestBuildAppDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-build-app/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestBuildAppGemfile = []byte(`source "https://rubygems.org" + +gem "rack" +`) + +func testExtendedTestdataTestBuildAppGemfileBytes() ([]byte, error) { + return _testExtendedTestdataTestBuildAppGemfile, nil +} + +func testExtendedTestdataTestBuildAppGemfile() (*asset, error) { + bytes, err := testExtendedTestdataTestBuildAppGemfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-build-app/Gemfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestBuildAppConfigRu = []byte(`run Proc.new {|env| [200, {"Content-Type" => "text/html"}, [ENV['TEST_ENV']]]} +`) + +func testExtendedTestdataTestBuildAppConfigRuBytes() ([]byte, error) { + return _testExtendedTestdataTestBuildAppConfigRu, nil +} + +func testExtendedTestdataTestBuildAppConfigRu() (*asset, error) { + bytes, err := testExtendedTestdataTestBuildAppConfigRuBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-build-app/config.ru", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestBuildPodsvcJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "parameters": [ + { + "name": "IMAGE_NAME", + "required": true + } + ], + "objects": [ + { + "kind":"Pod", + "apiVersion":"v1", + "metadata":{ + "name":"build-test-pod", + "labels":{ + "name":"build-test-pod" + } + }, + "spec":{ + "containers":[ + { + "name":"test", + "image":"${IMAGE_NAME}", + "readinessProbe": { + "httpGet": { + "port": 8080 + } + } + } + ], + "dnsPolicy":"ClusterFirst" + } + }, + { + "kind": "Service", + "apiVersion":"v1", + "metadata": { + "name":"build-test-svc" + }, + "spec": { + "ports": [ + { + "name": "8080-tcp", + "protocol": "TCP", + "port": 8080, + "targetPort": 8080 + } + ], + "selector": { + "name": "build-test-pod" + } + } + } + ] +} +`) + +func testExtendedTestdataTestBuildPodsvcJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestBuildPodsvcJson, nil +} + +func testExtendedTestdataTestBuildPodsvcJson() (*asset, error) { + bytes, err := testExtendedTestdataTestBuildPodsvcJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-build-podsvc.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestBuildPostcommitJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "busybox", + "creationTimestamp": null, + "labels": { + "build": "busybox" + } + }, + "spec": { + "tags": [ + { + "name": "1", + "annotations": { + "openshift.io/imported-from": "busybox:1" + }, + "from": { + "kind": "DockerImage", + "name": "busybox:1" + }, + "importPolicy": {} + } + ] + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "busybox", + "creationTimestamp": null, + "labels": { + "build": "busybox" + } + }, + "spec": { + "source": { + "type": "Dockerfile", + "dockerfile": "FROM busybox:1" + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "busybox:1" + } + } + }, + "resources": {}, + "postCommit": {} + } + } + ] +} +`) + +func testExtendedTestdataTestBuildPostcommitJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestBuildPostcommitJson, nil +} + +func testExtendedTestdataTestBuildPostcommitJson() (*asset, error) { + bytes, err := testExtendedTestdataTestBuildPostcommitJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-build-postcommit.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestBuildProxyJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-ruby-sample", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-build", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world.git", + "httpProxy": "127.0.0.1:3128", + "httpsProxy": "127.0.0.1:3128" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "env": [ + { "name": "HTTPS_PROXY", "value": "127.0.0.1:3128" }, + { "name": "HTTP_PROXY", "value": "127.0.0.1:3128" } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-build-noproxy", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world.git", + "httpProxy": "127.0.0.1:3128", + "httpsProxy": "127.0.0.1:3128", + "noProxy": "github.com" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + } + ] +} +`) + +func testExtendedTestdataTestBuildProxyJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestBuildProxyJson, nil +} + +func testExtendedTestdataTestBuildProxyJson() (*asset, error) { + bytes, err := testExtendedTestdataTestBuildProxyJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-build-proxy.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestBuildRevisionJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-build", + "creationTimestamp": null + }, + "spec": { + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + } + ] +} +`) + +func testExtendedTestdataTestBuildRevisionJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestBuildRevisionJson, nil +} + +func testExtendedTestdataTestBuildRevisionJson() (*asset, error) { + bytes, err := testExtendedTestdataTestBuildRevisionJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-build-revision.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestBuildJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-ruby-sample", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-build", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "env": [ + { "name": "FOO", "value": "test" }, + { "name": "BAR", "value": "test" }, + { "name": "BUILD_LOGLEVEL", "value": "5" } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-verbose-build", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "env": [ + { "name": "FOO", "value": "test" }, + { "name": "BAR", "value": "test" }, + { "name": "BUILD_LOGLEVEL", "value": "5" } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-build-binary", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Binary", + "binary": {} + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "env": [ + { "name": "FOO", "value": "test" }, + { "name": "BAR", "value": "test" }, + { "name": "BUILD_LOGLEVEL", "value": "5" } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-build-github-archive", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Binary", + "binary": {}, + "contextDir": "ruby-hello-world-master" + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "env": [ + { "name": "FOO", "value": "test" }, + { "name": "BAR", "value": "test" }, + { "name": "BUILD_LOGLEVEL", "value": "5" } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-build-binary-invalidnodeselector", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Binary", + "binary": {} + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "env": [ + { "name": "FOO", "value": "test" }, + { "name": "BAR", "value": "test" }, + { "name": "BUILD_LOGLEVEL", "value": "5" } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + }, + "resources": {}, + "nodeSelector": {"nodelabelkey":"nodelabelvalue"} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-build-docker-args", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "ImageChange", + "imageChange": {} + } + ], + "source": { + "type": "Dockerfile", + "dockerfile": "FROM centos/ruby-22-centos7\nARG foo\nRUN echo $foo" + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + }, + "resources": {}, + "postCommit": {}, + "nodeSelector": null + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "sample-build-docker-args-preset", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "ImageChange", + "imageChange": {} + } + ], + "source": { + "type": "Dockerfile", + "dockerfile": "FROM centos/ruby-22-centos7\nARG foo\nRUN echo $foo" + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + }, + "buildArgs": [ + { "name": "foo", "value": "default" } + ] + } + }, + "resources": {}, + "postCommit": {}, + "nodeSelector": null + }, + "status": { + "lastVersion": 0 + } + } + ] +} +`) + +func testExtendedTestdataTestBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestBuildJson, nil +} + +func testExtendedTestdataTestBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestBuildconfigsecretinjectorYaml = []byte(`kind: List +apiVersion: v1 +items: +- kind: Secret + apiVersion: v1 + type: kubernetes.io/basic-auth + metadata: + name: secret1 + annotations: + build.openshift.io/source-secret-match-uri-1: '*://*.example.com/*' + data: + username: AA== +- kind: Secret + apiVersion: v1 + type: kubernetes.io/ssh-auth + metadata: + name: secret2 + annotations: + build.openshift.io/source-secret-match-uri-1: '*://*.example.com/*' + data: + ssh-privatekey: AA== +- kind: Secret + apiVersion: v1 + type: kubernetes.io/basic-auth + metadata: + name: secret3 + annotations: + build.openshift.io/source-secret-match-uri-1: 'https://*.com/*' + data: + username: AA== +- kind: BuildConfig + apiVersion: v1 + metadata: + name: test1 + spec: + source: + type: Git + git: + uri: https://server1.example.com/path + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStream + name: test +- kind: BuildConfig + apiVersion: v1 + metadata: + name: test2 + spec: + source: + type: Git + git: + uri: ssh://server1.example.com/path + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStream + name: test +- kind: BuildConfig + apiVersion: v1 + metadata: + name: test3 + spec: + source: + type: Git + git: + uri: https://test.com/path + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStream + name: test +- kind: BuildConfig + apiVersion: v1 + metadata: + name: test4 + spec: + source: + type: Git + git: + uri: http://test.com/path + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStream + name: test +`) + +func testExtendedTestdataTestBuildconfigsecretinjectorYamlBytes() ([]byte, error) { + return _testExtendedTestdataTestBuildconfigsecretinjectorYaml, nil +} + +func testExtendedTestdataTestBuildconfigsecretinjectorYaml() (*asset, error) { + bytes, err := testExtendedTestdataTestBuildconfigsecretinjectorYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-buildconfigsecretinjector.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestCdsDockerbuildJson = []byte(`{ + "kind":"BuildConfig", + "apiVersion":"v1", + "metadata":{ + "name":"docker-build" + }, + "spec":{ + "completionDeadlineSeconds": 5, + "triggers":[], + "source":{ + "type":"Dockerfile", + "dockerfile":"FROM centos:7\nRUN sleep 10m" + }, + "strategy":{ + "type":"Docker", + "dockerStrategy":{ + "from":{ + "kind":"DockerImage", + "name":"centos/ruby-22-centos7" + } + } + } + } +} +`) + +func testExtendedTestdataTestCdsDockerbuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestCdsDockerbuildJson, nil +} + +func testExtendedTestdataTestCdsDockerbuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestCdsDockerbuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-cds-dockerbuild.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestCdsSourcebuildJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-ruby-sample" + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "source-build" + }, + "spec": { + "completionDeadlineSeconds": 5, + "triggers": [], + "source":{ + "type":"Dockerfile", + "dockerfile":"FROM centos:7\nRUN sleep 10m" + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + } + } + } + ] +} +`) + +func testExtendedTestdataTestCdsSourcebuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestCdsSourcebuildJson, nil +} + +func testExtendedTestdataTestCdsSourcebuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestCdsSourcebuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-cds-sourcebuild.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestCliDebugYaml = []byte(`kind: List +apiVersion: v1 +items: +- kind: ImageStream + apiVersion: v1 + metadata: + name: local-busybox + +- kind: BuildConfig + apiVersion: v1 + metadata: + name: local-busybox + spec: + strategy: + type: Docker + source: + type: Git + dockerfile: "FROM busybox:latest\n" + output: + to: + kind: ImageStreamTag + name: local-busybox:latest + triggers: + - type: ConfigChange + +- kind: DeploymentConfig + apiVersion: v1 + metadata: + name: local-busybox1 + spec: + replicas: 0 + selector: + deploymentconfig: local-busybox1 + template: + metadata: + labels: + deploymentconfig: local-busybox1 + spec: + containers: + - name: local-busybox + triggers: + - type: ImageChange + imageChangeParams: + automatic: true + containerNames: + - local-busybox + from: + kind: ImageStreamTag + name: local-busybox:latest + +- kind: DeploymentConfig + apiVersion: v1 + metadata: + name: local-busybox2 + spec: + replicas: 0 + selector: + deploymentconfig: local-busybox2 + template: + metadata: + labels: + deploymentconfig: local-busybox2 + spec: + containers: + - name: local-busybox + command: + - foo + - bar + args: + - baz + - qux + triggers: + - type: ImageChange + imageChangeParams: + automatic: true + containerNames: + - local-busybox + from: + kind: ImageStreamTag + name: local-busybox:latest + +- kind: DeploymentConfig + apiVersion: v1 + metadata: + name: busybox1 + spec: + replicas: 0 + selector: + deploymentconfig: busybox1 + template: + metadata: + labels: + deploymentconfig: busybox1 + spec: + containers: + - name: busybox + image: busybox + +- kind: DeploymentConfig + apiVersion: v1 + metadata: + name: busybox2 + spec: + replicas: 0 + selector: + deploymentconfig: busybox2 + template: + metadata: + labels: + deploymentconfig: busybox2 + spec: + containers: + - name: busybox + image: busybox + command: + - foo + - bar + args: + - baz + - qux +`) + +func testExtendedTestdataTestCliDebugYamlBytes() ([]byte, error) { + return _testExtendedTestdataTestCliDebugYaml, nil +} + +func testExtendedTestdataTestCliDebugYaml() (*asset, error) { + bytes, err := testExtendedTestdataTestCliDebugYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-cli-debug.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestContextBuildJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "dockercontext" + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri":"https://github.com/sclorg/s2i-ruby-container" + }, + "contextDir": "2.3" + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ] + } + } + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "s2icontext" + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri":"https://github.com/sclorg/s2i-ruby-container" + }, + "contextDir": "2.3/test/puma-test-app" + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-23-centos7" + } + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "test:latest" + } + } + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "test" + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend" + }, + "spec": { + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "frontend" + ], + "from": { + "kind": "ImageStreamTag", + "name": "test:latest" + } + } + } + ], + "replicas": 1, + "selector": { + "name":"frontend" + }, + "template": { + "metadata": { + "labels": { + "name": "frontend" + } + }, + "spec": { + "containers": [ + { + "name": "frontend", + "image": "", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ] + } + ] + } + } + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend" + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 5432, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + } + ] +}`) + +func testExtendedTestdataTestContextBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestContextBuildJson, nil +} + +func testExtendedTestdataTestContextBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestContextBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-context-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestCustomBuildJson = []byte(`{ + "kind": "Build", + "apiVersion": "v1", + "metadata": { + "name": "testcustom", + "creationTimestamp": null, + "labels": { + "name": "testcustom" + } + }, + "spec": { + "source": {}, + "strategy": { + "type": "Custom", + "customStrategy": { + "from": { + "kind": "DockerImage", + "name": "" + }, + "exposeDockerSocket": false + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "test:application" + } + }, + "resources": {} + }, + "status": { + "phase": "" + } +} +`) + +func testExtendedTestdataTestCustomBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestCustomBuildJson, nil +} + +func testExtendedTestdataTestCustomBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestCustomBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-custom-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestDockerBuildPullsecretJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [{ + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "image1", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + }, { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "docker-build", + "creationTimestamp": null, + "labels": { + "name": "docker-build" + } + }, + "spec": { + "source": { + "dockerfile": "FROM centos:7" + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos:7" + } + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "image1:latest" + } + } + } + }, { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "docker-build-pull", + "creationTimestamp": null, + "labels": { + "name": "docker-build-pull" + } + }, + "spec": { + "source": { + "dockerfile": "FROM centos:7" + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "image1:latest" + }, + "forcePull": true + } + } + } + }] +} +`) + +func testExtendedTestdataTestDockerBuildPullsecretJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestDockerBuildPullsecretJson, nil +} + +func testExtendedTestdataTestDockerBuildPullsecretJson() (*asset, error) { + bytes, err := testExtendedTestdataTestDockerBuildPullsecretJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-docker-build-pullsecret.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestDockerBuildQuotaJson = []byte(`{ + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "docker-build-quota", + "creationTimestamp": null, + "labels": { + "name": "docker-build-quota" + } + }, + "spec": { + "resources": { + "limits": { + "cpu": "60m", + "memory": "200Mi" + } + }, + "source": { + "binary": { + "asFile": "" + } + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos:7" + }, + "noCache": true + } + } + } +} + `) + +func testExtendedTestdataTestDockerBuildQuotaJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestDockerBuildQuotaJson, nil +} + +func testExtendedTestdataTestDockerBuildQuotaJson() (*asset, error) { + bytes, err := testExtendedTestdataTestDockerBuildQuotaJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-docker-build-quota.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestDockerBuildJson = []byte(`{ + "kind":"BuildConfig", + "apiVersion":"v1", + "metadata":{ + "name":"test", + "labels":{ + "name":"test" + } + }, + "spec":{ + "triggers":[], + "source":{ + "type":"Git", + "git":{ + "uri":"https://github.com/sclorg/s2i-ruby-container" + }, + "contextDir":"2.3" + }, + "strategy":{ + "type":"Docker", + "dockerStrategy":{ + "from":{ + "kind":"DockerImage", + "name":"openshift/base-centos7" + } + } + }, + "output":{ + "to":{ + "kind":"ImageStreamTag", + "name":"test:latest" + }, + "imageLabels": [ + { + "name": "user-specified-label", + "value": "arbitrary-value" + } + ] + } + } +} +`) + +func testExtendedTestdataTestDockerBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestDockerBuildJson, nil +} + +func testExtendedTestdataTestDockerBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestDockerBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-docker-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestDockerNoOutputnameJson = []byte(`{ + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "test-docker", + "labels": { + "name": "test-docker" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world" + } + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + } + } +}`) + +func testExtendedTestdataTestDockerNoOutputnameJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestDockerNoOutputnameJson, nil +} + +func testExtendedTestdataTestDockerNoOutputnameJson() (*asset, error) { + bytes, err := testExtendedTestdataTestDockerNoOutputnameJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-docker-no-outputname.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestEnvBuildJson = []byte(`{ + "kind":"BuildConfig", + "apiVersion":"v1", + "metadata":{ + "name":"test", + "labels":{ + "name":"test" + } + }, + "spec":{ + "triggers":[], + "source":{ + "type":"Binary" + }, + "strategy":{ + "type":"Source", + "sourceStrategy":{ + "from":{ + "kind":"DockerImage", + "name":"centos/ruby-22-centos7" + } + } + }, + "output":{ + "to":{ + "kind":"ImageStreamTag", + "name":"test:latest" + } + } + } +} +`) + +func testExtendedTestdataTestEnvBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestEnvBuildJson, nil +} + +func testExtendedTestdataTestEnvBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestEnvBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-env-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestEnvPodJson = []byte(`{ + "kind":"Pod", + "apiVersion":"v1", + "metadata":{ + "name":"test-pod", + "labels":{ + "name":"test-pod" + } + }, + "spec":{ + "containers":[ + { + "name":"test", + "image":"centos:centos7", + "env": [ + { + "name":"podname", + "valueFrom": { + "fieldRef": { + "fieldPath":"metadata.name" + } + } + }, + { + "name":"podname_composed", + "value":"$(podname)_composed" + }, + { + "name":"var1", + "value":"value1" + }, + { + "name":"var2", + "value":"$(var1)" + }, + { + "name":"var3", + "value":"120" + } + ], + "command": [ + "sleep", + "$(var3)" + ] + } + ], + "restartPolicy":"Never", + "dnsPolicy":"ClusterFirst" + } +} +`) + +func testExtendedTestdataTestEnvPodJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestEnvPodJson, nil +} + +func testExtendedTestdataTestEnvPodJson() (*asset, error) { + bytes, err := testExtendedTestdataTestEnvPodJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-env-pod.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestGitserverTokenauthYaml = []byte(`apiVersion: v1 +kind: Template +labels: + template: gitserver +metadata: + name: gitserver +parameters: +- name: ROUTE_SUFFIX + required: true +objects: +# The gitserver is deployed as a singleton pod and uses a very small amount +# of resources. It can host or transiently serve Git repositories, as well +# as automatically integrate with builds in a namespace. +- apiVersion: v1 + kind: DeploymentConfig + metadata: + name: gitserver + labels: + app: gitserver + spec: + replicas: 1 # the gitserver is not HA and should not be scaled past 1 + selector: + run-container: gitserver + template: + metadata: + labels: + run-container: gitserver + spec: + containers: + - name: gitserver + image: openshift/origin-gitserver + readinessProbe: + tcpSocket: + port: 8080 + ports: + - containerPort: 8080 + + env: + # Each environment variable matching GIT_INITIAL_CLONE_* will + # be cloned when the process starts; failures will be logged. + # must be [A-Z0-9_\-\.], the cloned directory name will + # be lowercased. If the name is invalid the pod will halt. If + # the repository already exists on disk, it will be updated + # from the remote. + # + - name: GIT_INITIAL_CLONE_1 + value: https://github.com/openshift/ruby-hello-world.git;ruby-hello-world + + + # The namespace of the pod is required for implicit config + # (passing '-' to AUTOLINK_KUBECONFIG or REQUIRE_SERVER_AUTH) + # and can also be used to target a specific namespace. + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + + # The URL that builds must use to access the Git repositories + # stored in this app. + # TODO: support HTTPS + - name: PUBLIC_URL + value: http://gitserver-tokenauth.$(POD_NAMESPACE).svc.cluster.local:8080 + # The directory to store Git repositories in. If not backed + # by a persistent volume, repositories will be lost when + # deployments occur. Use INITIAL_GIT_CLONE and AUTOLINK_* + # to remove the need to use a persistent volume. + - name: GIT_HOME + value: /var/lib/git + # The directory to use as the default hook directory for any + # cloned or autolinked directories. + - name: HOOK_PATH + value: /var/lib/git-hooks + + # Authentication and authorization + + # If 'yes', clients may push to the server with git push. + - name: ALLOW_GIT_PUSH + value: "yes" + # If 'yes', clients may set hooks via the API. However, unless + # the Git home is backed by a persistent volume, any deployment + # will result in the hooks being lost. + - name: ALLOW_GIT_HOOKS + value: "yes" + # If 'yes', clients can create new git repositories on demand + # by pushing. If the data on disk is not backed by a persistent + # volume, the Git repo will be deleted if the deployment is + # updated. + - name: ALLOW_LAZY_CREATE + value: "yes" + # If 'yes', clients can pull without being authenticated. + - name: ALLOW_ANON_GIT_PULL + + # Provides the path to a kubeconfig file in the image that + # should be used to authorize against the server. The value + # '-' will use the pod's service account. + # May not be used in combination with REQUIRE_GIT_AUTH + - name: REQUIRE_SERVER_AUTH + value: "-" + + # The namespace to check authorization against when + # REQUIRE_SERVICE_AUTH is used. Users must have 'get' on + # 'pods' to pull and 'create' on 'pods' to push. + - name: AUTH_NAMESPACE + value: $(POD_NAMESPACE) + # Require BASIC authentication with a username and password + # to push or pull. + # May not be used in combination with REQUIRE_SERVER_AUTH + #- name: REQUIRE_GIT_AUTH + # value: gituser:gituserpassword + + # Autolinking: + # + # The gitserver can automatically clone Git repositories + # associated with a build config and replace the URL with + # a link to the repo on PUBLIC_URL. The default post-receive + # hook on the cloned repo will then trigger a build. You + # may customize the hook with AUTOLINK_HOOK (path to hook). + # To autolink, the account the pod runs under must have 'edit' + # on the AUTOLINK_NAMESPACE: + # + # oc policy add-role-to-user \ + # system:serviceaccount:${namespace}:gitserver edit + # + # Links are checked every time the pod starts. + + # The location to read auth configuration from for autolinking. + # If '-', use the service account token to link. The account + # represented by this config must have the edit role on the + # namespace. + #- name: AUTOLINK_KUBECONFIG + # value: "-" + + # The namespace to autolink + #- name: AUTOLINK_NAMESPACE + # value: $(POD_NAMESPACE) + + # The path to a script in the image to use as the default + # post-receive hook - only set during link, so has no effect + # on cloned repositories. See the "hooks" directory in the + # image for examples. + #- name: AUTOLINK_HOOK + + # The master service host is not signed with the service IP + # so we override with the consistent DNS name. Required for + # connections to the server. + - name: KUBERNETES_SERVICE_HOST + value: kubernetes.default + + volumeMounts: + - mountPath: /var/lib/git/ + name: git + volumes: + - name: git + triggers: + - type: ConfigChange + +# The gitserver service is required for DNS resolution +- apiVersion: v1 + kind: Service + metadata: + name: gitserver-tokenauth + labels: + app: gitserver + spec: + ports: + - port: 8080 + targetPort: 8080 + selector: + run-container: gitserver +- apiVersion: v1 + kind: Route + metadata: + name: gitserver-tokenauth + labels: + app: gitserver + spec: + host: gitserver-tokenauth.${ROUTE_SUFFIX} + tls: + termination: edge + to: + kind: Service + name: gitserver-tokenauth +`) + +func testExtendedTestdataTestGitserverTokenauthYamlBytes() ([]byte, error) { + return _testExtendedTestdataTestGitserverTokenauthYaml, nil +} + +func testExtendedTestdataTestGitserverTokenauthYaml() (*asset, error) { + bytes, err := testExtendedTestdataTestGitserverTokenauthYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-gitserver-tokenauth.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestGitserverYaml = []byte(`apiVersion: v1 +kind: Template +labels: + template: gitserver +metadata: + name: gitserver +parameters: +- name: ROUTE_SUFFIX + required: true +objects: +# The gitserver is deployed as a singleton pod and uses a very small amount +# of resources. It can host or transiently serve Git repositories, as well +# as automatically integrate with builds in a namespace. +- apiVersion: v1 + kind: DeploymentConfig + metadata: + name: gitserver + labels: + app: gitserver + spec: + replicas: 1 # the gitserver is not HA and should not be scaled past 1 + selector: + run-container: gitserver + template: + metadata: + labels: + run-container: gitserver + spec: + containers: + - name: gitserver + image: openshift/origin-gitserver + readinessProbe: + tcpSocket: + port: 8080 + ports: + - containerPort: 8080 + + env: + # Each environment variable matching GIT_INITIAL_CLONE_* will + # be cloned when the process starts; failures will be logged. + # must be [A-Z0-9_\-\.], the cloned directory name will + # be lowercased. If the name is invalid the pod will halt. If + # the repository already exists on disk, it will be updated + # from the remote. + # + - name: GIT_INITIAL_CLONE_1 + value: https://github.com/openshift/ruby-hello-world.git;ruby-hello-world + + + # The namespace of the pod is required for implicit config + # (passing '-' to AUTOLINK_KUBECONFIG or REQUIRE_SERVER_AUTH) + # and can also be used to target a specific namespace. + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + + # The URL that builds must use to access the Git repositories + # stored in this app. + # TODO: support HTTPS + - name: PUBLIC_URL + value: http://gitserver.$(POD_NAMESPACE).svc.cluster.local:8080 + # The directory to store Git repositories in. If not backed + # by a persistent volume, repositories will be lost when + # deployments occur. Use INITIAL_GIT_CLONE and AUTOLINK_* + # to remove the need to use a persistent volume. + - name: GIT_HOME + value: /var/lib/git + # The directory to use as the default hook directory for any + # cloned or autolinked directories. + - name: HOOK_PATH + value: /var/lib/git-hooks + + # Authentication and authorization + + # If 'yes', clients may push to the server with git push. + - name: ALLOW_GIT_PUSH + value: "yes" + # If 'yes', clients may set hooks via the API. However, unless + # the Git home is backed by a persistent volume, any deployment + # will result in the hooks being lost. + - name: ALLOW_GIT_HOOKS + value: "yes" + # If 'yes', clients can create new git repositories on demand + # by pushing. If the data on disk is not backed by a persistent + # volume, the Git repo will be deleted if the deployment is + # updated. + - name: ALLOW_LAZY_CREATE + value: "yes" + # If 'yes', clients can pull without being authenticated. + - name: ALLOW_ANON_GIT_PULL + + # Provides the path to a kubeconfig file in the image that + # should be used to authorize against the server. The value + # '-' will use the pod's service account. + # May not be used in combination with REQUIRE_GIT_AUTH + #- name: REQUIRE_SERVER_AUTH + # value: "-" + + # The namespace to check authorization against when + # REQUIRE_SERVICE_AUTH is used. Users must have 'get' on + # 'pods' to pull and 'create' on 'pods' to push. + - name: AUTH_NAMESPACE + value: $(POD_NAMESPACE) + # Require BASIC authentication with a username and password + # to push or pull. + # May not be used in combination with REQUIRE_SERVER_AUTH + - name: REQUIRE_GIT_AUTH + value: gituser:gituserpassword + + # Autolinking: + # + # The gitserver can automatically clone Git repositories + # associated with a build config and replace the URL with + # a link to the repo on PUBLIC_URL. The default post-receive + # hook on the cloned repo will then trigger a build. You + # may customize the hook with AUTOLINK_HOOK (path to hook). + # To autolink, the account the pod runs under must have 'edit' + # on the AUTOLINK_NAMESPACE: + # + # oc policy add-role-to-user \ + # system:serviceaccount:${namespace}:gitserver edit + # + # Links are checked every time the pod starts. + + # The location to read auth configuration from for autolinking. + # If '-', use the service account token to link. The account + # represented by this config must have the edit role on the + # namespace. + #- name: AUTOLINK_KUBECONFIG + # value: "-" + + # The namespace to autolink + #- name: AUTOLINK_NAMESPACE + # value: $(POD_NAMESPACE) + + # The path to a script in the image to use as the default + # post-receive hook - only set during link, so has no effect + # on cloned repositories. See the "hooks" directory in the + # image for examples. + #- name: AUTOLINK_HOOK + + # The master service host is not signed with the service IP + # so we override with the consistent DNS name. Required for + # connections to the server. + - name: KUBERNETES_SERVICE_HOST + value: kubernetes.default + + volumeMounts: + - mountPath: /var/lib/git/ + name: git + volumes: + - name: git + triggers: + - type: ConfigChange + +# The gitserver service is required for DNS resolution +- apiVersion: v1 + kind: Service + metadata: + name: gitserver + labels: + app: gitserver + spec: + ports: + - port: 8080 + targetPort: 8080 + selector: + run-container: gitserver +- apiVersion: v1 + kind: Route + metadata: + name: gitserver + labels: + app: gitserver + spec: + host: gitserver.${ROUTE_SUFFIX} + tls: + termination: edge + to: + kind: Service + name: gitserver +`) + +func testExtendedTestdataTestGitserverYamlBytes() ([]byte, error) { + return _testExtendedTestdataTestGitserverYaml, nil +} + +func testExtendedTestdataTestGitserverYaml() (*asset, error) { + bytes, err := testExtendedTestdataTestGitserverYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-gitserver.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestImagesourceBuildYaml = []byte(`apiVersion: v1 +kind: List +metadata: {} +items: +- apiVersion: v1 + kind: BuildConfig + metadata: + labels: + build: imagesourcebuild + name: imagesourcebuild + spec: + output: + to: + kind: ImageStreamTag + name: imagesourceapp:latest + source: + git: + uri: https://github.com/openshift/ruby-hello-world.git + images: + - from: + kind: ImageStreamTag + name: ruby:2.3 + namespace: openshift + paths: + - destinationDir: injected/dir + sourcePath: /opt/rh/rh-ruby23/root/usr/bin/ruby + strategy: + sourceStrategy: + forcePull: true + from: + kind: ImageStreamTag + name: ruby:latest + namespace: openshift +- apiVersion: v1 + kind: BuildConfig + metadata: + labels: + build: imagedockerbuild + name: imagedockerbuild + spec: + output: + to: + kind: ImageStreamTag + name: imagedockerapp:latest + source: + git: + uri: https://github.com/openshift/ruby-hello-world.git + images: + - from: + kind: ImageStreamTag + name: ruby:2.3 + namespace: openshift + paths: + - destinationDir: injected/dir + sourcePath: /opt/rh/rh-ruby23/root/usr/bin/ruby + strategy: + dockerStrategy: {} +- apiVersion: v1 + kind: ImageStream + metadata: + name: imagesourceapp + spec: {} +- apiVersion: v1 + kind: ImageStream + metadata: + name: imagedockerapp + spec: {} + +- apiVersion: v1 + kind: DeploymentConfig + metadata: + name: imagesourceapp + spec: + replicas: 1 + selector: + app: imagesourceapp + deploymentconfig: imagesourceapp + strategy: + type: Rolling + template: + metadata: + labels: + app: imagesourceapp + deploymentconfig: imagesourceapp + spec: + containers: + - image: + imagePullPolicy: Always + readinessProbe: + httpGet: + port: 8080 + name: imagesourceapp + ports: + - containerPort: 8080 + protocol: TCP + - containerPort: 8888 + protocol: TCP + terminationMessagePath: /dev/termination-log + dnsPolicy: ClusterFirst + restartPolicy: Always + securityContext: {} + triggers: + - imageChangeParams: + automatic: true + containerNames: + - imagesourceapp + from: + kind: ImageStreamTag + name: imagesourceapp:latest + type: ImageChange + - type: ConfigChange + +- apiVersion: v1 + kind: DeploymentConfig + metadata: + name: imagedockerapp + spec: + replicas: 1 + selector: + app: imagedockerapp + deploymentconfig: imagedockerapp + strategy: + type: Rolling + template: + metadata: + labels: + app: imagedockerapp + deploymentconfig: imagedockerapp + spec: + containers: + - image: + imagePullPolicy: Always + readinessProbe: + httpGet: + port: 8080 + name: imagedockerapp + ports: + - containerPort: 8080 + protocol: TCP + - containerPort: 8888 + protocol: TCP + terminationMessagePath: /dev/termination-log + dnsPolicy: ClusterFirst + restartPolicy: Always + securityContext: {} + triggers: + - imageChangeParams: + automatic: true + containerNames: + - imagedockerapp + from: + kind: ImageStreamTag + name: imagedockerapp:latest + type: ImageChange + - type: ConfigChange +`) + +func testExtendedTestdataTestImagesourceBuildYamlBytes() ([]byte, error) { + return _testExtendedTestdataTestImagesourceBuildYaml, nil +} + +func testExtendedTestdataTestImagesourceBuildYaml() (*asset, error) { + bytes, err := testExtendedTestdataTestImagesourceBuildYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-imagesource-build.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestNosrcBuildJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "nosrc-stream", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "nosrc-build", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + ], + "source": { + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + } + } + } + ] +} +`) + +func testExtendedTestdataTestNosrcBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestNosrcBuildJson, nil +} + +func testExtendedTestdataTestNosrcBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestNosrcBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-nosrc-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestS2iBuildQuotaJson = []byte(`{ + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "s2i-build-quota", + "creationTimestamp": null, + "labels": { + "name": "s2i-build-quota" + } + }, + "spec": { + "resources": { + "limits": { + "cpu": "60m", + "memory": "200Mi" + } + }, + "source": { + "binary": { + "asFile": "" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind":"DockerImage", + "name":"centos/ruby-22-centos7" + } + } + } + } +} +`) + +func testExtendedTestdataTestS2iBuildQuotaJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestS2iBuildQuotaJson, nil +} + +func testExtendedTestdataTestS2iBuildQuotaJson() (*asset, error) { + bytes, err := testExtendedTestdataTestS2iBuildQuotaJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-s2i-build-quota.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestS2iBuildJson = []byte(`{ + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "test", + "labels": { + "name": "test" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri":"https://github.com/sclorg/s2i-ruby-container" + }, + "contextDir": "2.3/test/puma-test-app" + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-23-centos7" + } + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "test:latest" + }, + "imageLabels": [ + { + "name": "user-specified-label", + "value": "arbitrary-value" + } + ] + } + } +} +`) + +func testExtendedTestdataTestS2iBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestS2iBuildJson, nil +} + +func testExtendedTestdataTestS2iBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestS2iBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-s2i-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestS2iNoOutputnameJson = []byte(`{ + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "test-sti", + "labels": { + "name": "test-sti" + } + }, + "spec": { + "triggers": [], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "env": [ + { + "name": "BUILD_LOGLEVEL", + "value": "5" + } + ], + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + } + } + } + } +}`) + +func testExtendedTestdataTestS2iNoOutputnameJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestS2iNoOutputnameJson, nil +} + +func testExtendedTestdataTestS2iNoOutputnameJson() (*asset, error) { + bytes, err := testExtendedTestdataTestS2iNoOutputnameJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-s2i-no-outputname.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestSecretBuildJson = []byte(`{ + "kind": "Build", + "apiVersion": "v1", + "metadata": { + "name": "testsecretbuilder", + "creationTimestamp": null, + "labels": { + "name": "testsecretbuilder" + } + }, + "spec": { + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/origin", + "ref": "build_secret_extended" + }, + "contextDir": "test/extended/testdata/custom-secret-builder" + }, + "strategy": { + "type": "Docker" + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "test:latest" + } + }, + "resources": {} + }, + "status": { + "phase": "" + } +}`) + +func testExtendedTestdataTestSecretBuildJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestSecretBuildJson, nil +} + +func testExtendedTestdataTestSecretBuildJson() (*asset, error) { + bytes, err := testExtendedTestdataTestSecretBuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-secret-build.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataTestSecretJson = []byte(`{ + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "docker", + "creationTimestamp": null + }, + "data": { + "dockercfg": "eyJodHRwczovL3JlZ2lzdHJ5aG9zdC92MSI6eyJhdXRoIjoic2VjcmV0IiwiZW1haWwiOiJqb2huQGRvZS5jb20ifX0K" + }, + "type": "Opaque" +}`) + +func testExtendedTestdataTestSecretJsonBytes() ([]byte, error) { + return _testExtendedTestdataTestSecretJson, nil +} + +func testExtendedTestdataTestSecretJson() (*asset, error) { + bytes, err := testExtendedTestdataTestSecretJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/test-secret.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testExtendedTestdataWeightedRouterYaml = []byte(`apiVersion: v1 +kind: Template +parameters: +- name: IMAGE + value: openshift/origin-haproxy-router:latest +objects: +# a weighted router +- apiVersion: v1 + kind: Pod + metadata: + name: weighted-router + labels: + test: weighted-router + spec: + containers: + - name: router + image: ${IMAGE} + imagePullPolicy: IfNotPresent + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + args: ["--namespace=$(POD_NAMESPACE)", "--loglevel=4", "--labels=select=weighted", "--stats-password=password", "--stats-port=1936", "--stats-user=admin"] + hostNetwork: false + ports: + - containerPort: 80 + - containerPort: 443 + - containerPort: 1936 + name: stats + protocol: TCP + serviceAccountName: default + +# ensure the router can access routes and endpoints +- apiVersion: v1 + kind: RoleBinding + metadata: + name: system-router + subjects: + - kind: ServiceAccount + name: default + roleRef: + name: system:router + +# a route that has multiple weighted services that it points to +- apiVersion: v1 + kind: Route + metadata: + name: weightedroute + labels: + test: router + select: weighted + spec: + host: weighted.example.com + to: + name: weightedendpoints1 + kind: Service + weight: 90 + alternateBackends: + - name: weightedendpoints2 + kind: Service + weight: 10 + ports: + - targetPort: 8080 + +# a route that has multiple services but all weights are zero +- apiVersion: v1 + kind: Route + metadata: + name: zeroweightroute + labels: + test: router + select: weighted + spec: + host: zeroweight.example.com + to: + name: weightedendpoints1 + kind: Service + weight: 0 + alternateBackends: + - name: weightedendpoints2 + kind: Service + weight: 0 + ports: + - targetPort: 8080 + +# two services that can be routed to +- apiVersion: v1 + kind: Service + metadata: + name: weightedendpoints1 + labels: + test: router + spec: + selector: + test: weightedrouter1 + endpoints: weightedrouter1 + ports: + - port: 8080 +- apiVersion: v1 + kind: Service + metadata: + name: weightedendpoints2 + labels: + test: router + spec: + selector: + test: weightedrouter2 + endpoints: weightedrouter2 + ports: + - port: 8080 +# two pods that serves a response +- apiVersion: v1 + kind: Pod + metadata: + name: endpoint-1 + labels: + test: weightedrouter1 + endpoints: weightedrouter1 + spec: + containers: + - name: test + image: openshift/hello-openshift + ports: + - containerPort: 8080 + name: http + - containerPort: 100 + protocol: UDP +- apiVersion: v1 + kind: Pod + metadata: + name: endpoint-2 + labels: + test: weightedrouter2 + endpoints: weightedrouter2 + spec: + containers: + - name: test + image: openshift/hello-openshift + ports: + - containerPort: 8080 + name: http + - containerPort: 100 + protocol: UDP +`) + +func testExtendedTestdataWeightedRouterYamlBytes() ([]byte, error) { + return _testExtendedTestdataWeightedRouterYaml, nil +} + +func testExtendedTestdataWeightedRouterYaml() (*asset, error) { + bytes, err := testExtendedTestdataWeightedRouterYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/extended/testdata/weighted-router.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataProjectRequestTemplateWithQuotaYaml = []byte(`apiVersion: v1 +kind: Template +metadata: + creationTimestamp: 2015-10-24T18:25:22Z + name: default-project-request + namespace: default +objects: +- apiVersion: v1 + kind: Project + metadata: + annotations: + openshift.io/description: ${PROJECT_DESCRIPTION} + openshift.io/display-name: ${PROJECT_DISPLAYNAME} + extra: here + creationTimestamp: null + name: ${PROJECT_NAME} + spec: {} + status: {} +- apiVersion: v1 + kind: ResourceQuota + metadata: + name: ${PROJECT_NAME}-quota + spec: + hard: + cpu: 200m + memory: 512Mi + pods: 3 + replicationcontrollers: 3 + resourcequotas: 1 + services: 3 +- apiVersion: v1 + kind: LimitRange + metadata: + creationTimestamp: null + name: ${PROJECT_NAME}-limits + spec: + limits: + - max: + cpu: 500m + memory: 750Mi + min: + cpu: 10m + memory: 5Mi + type: Pod + - default: + cpu: 100m + memory: 100Mi + max: + cpu: 500m + memory: 750Mi + min: + cpu: 10m + memory: 5Mi + type: Container +- apiVersion: v1 + groupNames: [] + kind: RoleBinding + metadata: + creationTimestamp: null + name: admins + namespace: ${PROJECT_NAME} + roleRef: + name: admin + subjects: + - kind: User + name: ${PROJECT_ADMIN_USER} + userNames: + - ${PROJECT_ADMIN_USER} +- apiVersion: v1 + groupNames: + - system:serviceaccounts:${PROJECT_NAME} + kind: RoleBinding + metadata: + creationTimestamp: null + name: system:image-pullers + namespace: ${PROJECT_NAME} + roleRef: + name: system:image-puller + subjects: + - kind: SystemGroup + name: system:serviceaccounts:${PROJECT_NAME} + userNames: [] +- apiVersion: v1 + groupNames: [] + kind: RoleBinding + metadata: + creationTimestamp: null + name: system:image-builders + namespace: ${PROJECT_NAME} + roleRef: + name: system:image-builder + subjects: + - kind: ServiceAccount + name: builder + userNames: + - system:serviceaccount:${PROJECT_NAME}:builder +- apiVersion: v1 + groupNames: [] + kind: RoleBinding + metadata: + creationTimestamp: null + name: system:deployers + namespace: ${PROJECT_NAME} + roleRef: + name: system:deployer + subjects: + - kind: ServiceAccount + name: deployer + userNames: + - system:serviceaccount:${PROJECT_NAME}:deployer +parameters: +- name: PROJECT_NAME +- name: PROJECT_DISPLAYNAME +- name: PROJECT_DESCRIPTION +- name: PROJECT_ADMIN_USER`) + +func testIntegrationTestdataProjectRequestTemplateWithQuotaYamlBytes() ([]byte, error) { + return _testIntegrationTestdataProjectRequestTemplateWithQuotaYaml, nil +} + +func testIntegrationTestdataProjectRequestTemplateWithQuotaYaml() (*asset, error) { + bytes, err := testIntegrationTestdataProjectRequestTemplateWithQuotaYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/project-request-template-with-quota.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestBuildcliBeta2Json = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "ruby-22-centos-buildcli", + "creationTimestamp": null + }, + "spec": { + "dockerImageRepository": "centos/ruby-22-centos", + "tags": [ + { + "name": "valid" + } + ] + }, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build-validtag", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "ruby-22-centos-buildcli:valid" + }, + "incremental": true + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build-invalidtag", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "ruby-22-centos-buildcli:invalid" + }, + "incremental": true + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + } + ] +} +`) + +func testIntegrationTestdataTestBuildcliBeta2JsonBytes() ([]byte, error) { + return _testIntegrationTestdataTestBuildcliBeta2Json, nil +} + +func testIntegrationTestdataTestBuildcliBeta2Json() (*asset, error) { + bytes, err := testIntegrationTestdataTestBuildcliBeta2JsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-buildcli-beta2.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestBuildcliJson = []byte(`{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "ruby-20-centos7-buildcli", + "creationTimestamp": null + }, + "spec": { + "dockerImageRepository": "centos/ruby-22-centos7", + "tags": [ + { + "name": "valid" + } + ] + }, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build-validtag", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + }, + "incremental": true + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build-invalidtag", + "creationTimestamp": null + }, + "spec": { + "triggers": [ + { + "type": "imageChange", + "imageChange": {} + } + ], + "source": { + "type": "Git", + "git": { + "uri": "git://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7" + }, + "incremental": true + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + } + ] +} +`) + +func testIntegrationTestdataTestBuildcliJsonBytes() ([]byte, error) { + return _testIntegrationTestdataTestBuildcliJson, nil +} + +func testIntegrationTestdataTestBuildcliJson() (*asset, error) { + bytes, err := testIntegrationTestdataTestBuildcliJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-buildcli.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestDeploymentConfigYaml = []byte(`apiVersion: v1 +kind: DeploymentConfig +metadata: + name: test-deployment-config +spec: + replicas: 1 + selector: + name: test-deployment + strategy: + type: Recreate + recreateParams: + timeoutSeconds: 20 + post: + failurePolicy: Ignore + tagImages: + - containerName: ruby-helloworld + to: + kind: ImageStreamTag + name: origin-ruby-sample:deployed + template: + metadata: + labels: + name: test-deployment + spec: + containers: + - image: openshift/origin-pod + imagePullPolicy: IfNotPresent + name: ruby-helloworld + ports: + - containerPort: 8080 + protocol: TCP + resources: + limits: + cpu: 100m + memory: 3Gi + dnsPolicy: ClusterFirst + restartPolicy: Always + volumes: + - emptyDir: {} + name: vol1 + triggers: + - type: ConfigChange +status: {} +`) + +func testIntegrationTestdataTestDeploymentConfigYamlBytes() ([]byte, error) { + return _testIntegrationTestdataTestDeploymentConfigYaml, nil +} + +func testIntegrationTestdataTestDeploymentConfigYaml() (*asset, error) { + bytes, err := testIntegrationTestdataTestDeploymentConfigYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-deployment-config.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestEgressNetworkPolicyJson = []byte(`{ + "kind": "EgressNetworkPolicy", + "apiVersion": "v1", + "metadata": { + "name": "default" + }, + "spec": { + "egress": [ + { + "type": "Allow", + "to": { + "cidrSelector": "192.168.0.0/16" + } + }, + { + "type": "Deny", + "to": { + "cidrSelector": "0.0.0.0/0" + } + } + ] + } +} +`) + +func testIntegrationTestdataTestEgressNetworkPolicyJsonBytes() ([]byte, error) { + return _testIntegrationTestdataTestEgressNetworkPolicyJson, nil +} + +func testIntegrationTestdataTestEgressNetworkPolicyJson() (*asset, error) { + bytes, err := testIntegrationTestdataTestEgressNetworkPolicyJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-egress-network-policy.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestImageStreamMappingJson = []byte(`{ + "kind": "ImageStreamMapping", + "apiVersion": "v1", + "metadata": { + "name": "test", + "creationTimestamp": null + }, + "image": { + "metadata": { + "name": "sha256:4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125", + "creationTimestamp": null + }, + "dockerImageReference": "openshift/ruby-19-centos:latest", + "dockerImageMetadata": { + "kind": "DockerImage", + "apiVersion": "1.0", + "Id": "", + "Created": null, + "ContainerConfig": {}, + "Config": {} + }, + "dockerImageMetadataVersion": "1.0", + "dockerImageManifest": "{\n \"name\": \"library/busybox\",\n \"tag\": \"latest\",\n \"architecture\": \"amd64\",\n \"fsLayers\": [\n {\n \"blobSum\": \"tarsum.dev+sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n },\n {\n \"blobSum\": \"tarsum.dev+sha256:d43a7079c4dd020e9c65419c2eb6751ea49d6f7f9337edd895596cd5f7aa6369\"\n },\n {\n \"blobSum\": \"tarsum.dev+sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n },\n {\n \"blobSum\": \"tarsum.dev+sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n }\n ],\n \"history\": [\n {\n \"v1Compatibility\": \"{\\\"id\\\":\\\"4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125\\\",\\\"parent\\\":\\\"ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2\\\",\\\"created\\\":\\\"2014-12-31T22:23:56.943403668Z\\\",\\\"container\\\":\\\"83dcf36ad1042b90f4ea8b2ebb60e61b2f1a451a883e04b388be299ad382b259\\\",\\\"container_config\\\":{\\\"Hostname\\\":\\\"7f674915980d\\\",\\\"Domainname\\\":\\\"\\\",\\\"User\\\":\\\"\\\",\\\"Memory\\\":0,\\\"MemorySwap\\\":0,\\\"CpuShares\\\":0,\\\"Cpuset\\\":\\\"\\\",\\\"AttachStdin\\\":false,\\\"AttachStdout\\\":false,\\\"AttachStderr\\\":false,\\\"PortSpecs\\\":null,\\\"ExposedPorts\\\":null,\\\"Tty\\\":false,\\\"OpenStdin\\\":false,\\\"StdinOnce\\\":false,\\\"Env\\\":[\\\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\\\"],\\\"Cmd\\\":[\\\"/bin/sh\\\",\\\"-c\\\",\\\"#(nop) CMD [/bin/sh]\\\"],\\\"Image\\\":\\\"ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2\\\",\\\"Volumes\\\":null,\\\"WorkingDir\\\":\\\"\\\",\\\"Entrypoint\\\":null,\\\"NetworkDisabled\\\":false,\\\"MacAddress\\\":\\\"\\\",\\\"OnBuild\\\":[]},\\\"docker_version\\\":\\\"1.4.1\\\",\\\"author\\\":\\\"Jerome Petazzoni \\\\u003cjerome@docker.com\\\\u003e\\\",\\\"config\\\":{\\\"Hostname\\\":\\\"7f674915980d\\\",\\\"Domainname\\\":\\\"\\\",\\\"User\\\":\\\"\\\",\\\"Memory\\\":0,\\\"MemorySwap\\\":0,\\\"CpuShares\\\":0,\\\"Cpuset\\\":\\\"\\\",\\\"AttachStdin\\\":false,\\\"AttachStdout\\\":false,\\\"AttachStderr\\\":false,\\\"PortSpecs\\\":null,\\\"ExposedPorts\\\":null,\\\"Tty\\\":false,\\\"OpenStdin\\\":false,\\\"StdinOnce\\\":false,\\\"Env\\\":[\\\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\\\"],\\\"Cmd\\\":[\\\"/bin/sh\\\"],\\\"Image\\\":\\\"ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2\\\",\\\"Volumes\\\":null,\\\"WorkingDir\\\":\\\"\\\",\\\"Entrypoint\\\":null,\\\"NetworkDisabled\\\":false,\\\"MacAddress\\\":\\\"\\\",\\\"OnBuild\\\":[]},\\\"architecture\\\":\\\"amd64\\\",\\\"os\\\":\\\"linux\\\",\\\"checksum\\\":\\\"tarsum.dev+sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\\",\\\"Size\\\":0}\\n\"\n },\n {\n \"v1Compatibility\": \"{\\\"id\\\":\\\"ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2\\\",\\\"parent\\\":\\\"df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b\\\",\\\"created\\\":\\\"2014-12-31T22:23:56.190797792Z\\\",\\\"container\\\":\\\"7f674915980dbcafb3096fa82369c2943194486dcb4e585e3490a2e66c530e44\\\",\\\"container_config\\\":{\\\"Hostname\\\":\\\"7f674915980d\\\",\\\"Domainname\\\":\\\"\\\",\\\"User\\\":\\\"\\\",\\\"Memory\\\":0,\\\"MemorySwap\\\":0,\\\"CpuShares\\\":0,\\\"Cpuset\\\":\\\"\\\",\\\"AttachStdin\\\":false,\\\"AttachStdout\\\":false,\\\"AttachStderr\\\":false,\\\"PortSpecs\\\":null,\\\"ExposedPorts\\\":null,\\\"Tty\\\":false,\\\"OpenStdin\\\":false,\\\"StdinOnce\\\":false,\\\"Env\\\":[\\\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\\\"],\\\"Cmd\\\":[\\\"/bin/sh\\\",\\\"-c\\\",\\\"#(nop) ADD file:8cf517d90fe79547c474641cc1e6425850e04abbd8856718f7e4a184ea878538 in /\\\"],\\\"Image\\\":\\\"df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b\\\",\\\"Volumes\\\":null,\\\"WorkingDir\\\":\\\"\\\",\\\"Entrypoint\\\":null,\\\"NetworkDisabled\\\":false,\\\"MacAddress\\\":\\\"\\\",\\\"OnBuild\\\":[]},\\\"docker_version\\\":\\\"1.4.1\\\",\\\"author\\\":\\\"Jerome Petazzoni \\\\u003cjerome@docker.com\\\\u003e\\\",\\\"config\\\":{\\\"Hostname\\\":\\\"7f674915980d\\\",\\\"Domainname\\\":\\\"\\\",\\\"User\\\":\\\"\\\",\\\"Memory\\\":0,\\\"MemorySwap\\\":0,\\\"CpuShares\\\":0,\\\"Cpuset\\\":\\\"\\\",\\\"AttachStdin\\\":false,\\\"AttachStdout\\\":false,\\\"AttachStderr\\\":false,\\\"PortSpecs\\\":null,\\\"ExposedPorts\\\":null,\\\"Tty\\\":false,\\\"OpenStdin\\\":false,\\\"StdinOnce\\\":false,\\\"Env\\\":[\\\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\\\"],\\\"Cmd\\\":null,\\\"Image\\\":\\\"df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b\\\",\\\"Volumes\\\":null,\\\"WorkingDir\\\":\\\"\\\",\\\"Entrypoint\\\":null,\\\"NetworkDisabled\\\":false,\\\"MacAddress\\\":\\\"\\\",\\\"OnBuild\\\":[]},\\\"architecture\\\":\\\"amd64\\\",\\\"os\\\":\\\"linux\\\",\\\"checksum\\\":\\\"tarsum.dev+sha256:d43a7079c4dd020e9c65419c2eb6751ea49d6f7f9337edd895596cd5f7aa6369\\\",\\\"Size\\\":2433303}\\n\"\n },\n {\n \"v1Compatibility\": \"{\\\"id\\\":\\\"df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b\\\",\\\"parent\\\":\\\"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\\\",\\\"created\\\":\\\"2014-10-01T20:46:07.263351912Z\\\",\\\"container\\\":\\\"2147a17cb1b2d6626ed78e5ef8ba4c71ce82c884bc3b57ab01e6114ff357cea4\\\",\\\"container_config\\\":{\\\"Hostname\\\":\\\"2147a17cb1b2\\\",\\\"Domainname\\\":\\\"\\\",\\\"User\\\":\\\"\\\",\\\"Memory\\\":0,\\\"MemorySwap\\\":0,\\\"CpuShares\\\":0,\\\"Cpuset\\\":\\\"\\\",\\\"AttachStdin\\\":false,\\\"AttachStdout\\\":false,\\\"AttachStderr\\\":false,\\\"PortSpecs\\\":null,\\\"ExposedPorts\\\":null,\\\"Tty\\\":false,\\\"OpenStdin\\\":false,\\\"StdinOnce\\\":false,\\\"Env\\\":[\\\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\\\"],\\\"Cmd\\\":[\\\"/bin/sh\\\",\\\"-c\\\",\\\"#(nop) MAINTAINER Jerome Petazzoni \\\\u003cjerome@docker.com\\\\u003e\\\"],\\\"Image\\\":\\\"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\\\",\\\"Volumes\\\":null,\\\"WorkingDir\\\":\\\"\\\",\\\"Entrypoint\\\":null,\\\"NetworkDisabled\\\":false,\\\"MacAddress\\\":\\\"\\\",\\\"OnBuild\\\":[]},\\\"docker_version\\\":\\\"1.2.0\\\",\\\"author\\\":\\\"Jerome Petazzoni \\\\u003cjerome@docker.com\\\\u003e\\\",\\\"config\\\":{\\\"Hostname\\\":\\\"2147a17cb1b2\\\",\\\"Domainname\\\":\\\"\\\",\\\"User\\\":\\\"\\\",\\\"Memory\\\":0,\\\"MemorySwap\\\":0,\\\"CpuShares\\\":0,\\\"Cpuset\\\":\\\"\\\",\\\"AttachStdin\\\":false,\\\"AttachStdout\\\":false,\\\"AttachStderr\\\":false,\\\"PortSpecs\\\":null,\\\"ExposedPorts\\\":null,\\\"Tty\\\":false,\\\"OpenStdin\\\":false,\\\"StdinOnce\\\":false,\\\"Env\\\":[\\\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\\\"],\\\"Cmd\\\":null,\\\"Image\\\":\\\"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\\\",\\\"Volumes\\\":null,\\\"WorkingDir\\\":\\\"\\\",\\\"Entrypoint\\\":null,\\\"NetworkDisabled\\\":false,\\\"MacAddress\\\":\\\"\\\",\\\"OnBuild\\\":[]},\\\"architecture\\\":\\\"amd64\\\",\\\"os\\\":\\\"linux\\\",\\\"checksum\\\":\\\"tarsum.dev+sha256:1b755912c77197c6a43539f2a708ef89d5849b8ce02642cb702e47afaa8195c3\\\",\\\"Size\\\":0}\\n\"\n },\n {\n \"v1Compatibility\": \"{\\\"id\\\":\\\"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\\\",\\\"comment\\\":\\\"Imported from -\\\",\\\"created\\\":\\\"2013-06-13T14:03:50.821769-07:00\\\",\\\"container_config\\\":{\\\"Hostname\\\":\\\"\\\",\\\"Domainname\\\":\\\"\\\",\\\"User\\\":\\\"\\\",\\\"Memory\\\":0,\\\"MemorySwap\\\":0,\\\"CpuShares\\\":0,\\\"Cpuset\\\":\\\"\\\",\\\"AttachStdin\\\":false,\\\"AttachStdout\\\":false,\\\"AttachStderr\\\":false,\\\"PortSpecs\\\":null,\\\"ExposedPorts\\\":null,\\\"Tty\\\":false,\\\"OpenStdin\\\":false,\\\"StdinOnce\\\":false,\\\"Env\\\":null,\\\"Cmd\\\":null,\\\"Image\\\":\\\"\\\",\\\"Volumes\\\":null,\\\"WorkingDir\\\":\\\"\\\",\\\"Entrypoint\\\":null,\\\"NetworkDisabled\\\":false,\\\"MacAddress\\\":\\\"\\\",\\\"OnBuild\\\":null},\\\"docker_version\\\":\\\"0.4.0\\\",\\\"architecture\\\":\\\"x86_64\\\",\\\"checksum\\\":\\\"tarsum.dev+sha256:324d4cf44ee7daa46266c1df830c61a7df615c0632176a339e7310e34723d67a\\\",\\\"Size\\\":0}\\n\"\n }\n ],\n \"schemaVersion\": 1,\n \"signatures\": [\n {\n \"header\": {\n \"jwk\": {\n \"crv\": \"P-256\",\n \"kid\": \"OIH7:HQFS:44FK:45VB:3B53:OIAG:TPL4:ATF5:6PNE:MGHN:NHQX:2GE4\",\n \"kty\": \"EC\",\n \"x\": \"Cu_UyxwLgHzE9rvlYSmvVdqYCXY42E9eNhBb0xNv0SQ\",\n \"y\": \"zUsjWJkeKQ5tv7S-hl1Tg71cd-CqnrtiiLxSi6N_yc8\"\n },\n \"alg\": \"ES256\"\n },\n \"signature\": \"bWiisabH8LgSXezUhjN8X3I7ESBo_fCXvFtqAwRmzozTfPHTr8edd13SU0KUJMq4X7_agEuLpSh1V8YGcBVpYg\",\n \"protected\": \"eyJmb3JtYXRMZW5ndGgiOjcwNjMsImZvcm1hdFRhaWwiOiJDbjAiLCJ0aW1lIjoiMjAxNS0wMy0zMVQxNjozMjoyOVoifQ\"\n }\n ]\n}" + }, + "tag": "sometag" +}`) + +func testIntegrationTestdataTestImageStreamMappingJsonBytes() ([]byte, error) { + return _testIntegrationTestdataTestImageStreamMappingJson, nil +} + +func testIntegrationTestdataTestImageStreamMappingJson() (*asset, error) { + bytes, err := testIntegrationTestdataTestImageStreamMappingJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-image-stream-mapping.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestImageStreamJson = []byte(`{ + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "test", + "creationTimestamp": null, + "labels": { + "color": "blue" + } + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } +}`) + +func testIntegrationTestdataTestImageStreamJsonBytes() ([]byte, error) { + return _testIntegrationTestdataTestImageStreamJson, nil +} + +func testIntegrationTestdataTestImageStreamJson() (*asset, error) { + bytes, err := testIntegrationTestdataTestImageStreamJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-image-stream.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestImageJson = []byte(`{ + "kind": "Image", + "apiVersion": "v1", + "metadata": { + "name": "test", + "creationTimestamp": null + }, + "dockerImageReference": "openshift/ruby-19-centos:latest", + "dockerImageMetadata": { + "kind": "DockerImage", + "apiVersion": "1.0", + "Id": "", + "Created": null, + "ContainerConfig": {}, + "Config": {} + }, + "dockerImageMetadataVersion": "1.0" +}`) + +func testIntegrationTestdataTestImageJsonBytes() ([]byte, error) { + return _testIntegrationTestdataTestImageJson, nil +} + +func testIntegrationTestdataTestImageJson() (*asset, error) { + bytes, err := testIntegrationTestdataTestImageJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-image.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestRouteJson = []byte(`{ + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "testroute", + "creationTimestamp": null, + "labels": { + "rtlabel1": "greatroute" + } + }, + "spec": { + "host": "test.example.com", + "to": { + "kind": "Service", + "name": "testservice" + } + }, + "status": {} +} +`) + +func testIntegrationTestdataTestRouteJsonBytes() ([]byte, error) { + return _testIntegrationTestdataTestRouteJson, nil +} + +func testIntegrationTestdataTestRouteJson() (*asset, error) { + bytes, err := testIntegrationTestdataTestRouteJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-route.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestServiceWithFinalizerJson = []byte(`{ + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null, + "labels": { + "name": "frontend" + }, + "finalizers": ["fake/one"] + }, + "spec": { + "ports": [ + { + "protocol": "TCP", + "port": 9998, + "targetPort": 9998, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } +}`) + +func testIntegrationTestdataTestServiceWithFinalizerJsonBytes() ([]byte, error) { + return _testIntegrationTestdataTestServiceWithFinalizerJson, nil +} + +func testIntegrationTestdataTestServiceWithFinalizerJson() (*asset, error) { + bytes, err := testIntegrationTestdataTestServiceWithFinalizerJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-service-with-finalizer.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _testIntegrationTestdataTestServiceJson = []byte(`{ + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null, + "labels": { + "name": "frontend" + } + }, + "spec": { + "ports": [ + { + "protocol": "TCP", + "port": 9998, + "targetPort": 9998, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } +}`) + +func testIntegrationTestdataTestServiceJsonBytes() ([]byte, error) { + return _testIntegrationTestdataTestServiceJson, nil +} + +func testIntegrationTestdataTestServiceJson() (*asset, error) { + bytes, err := testIntegrationTestdataTestServiceJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "test/integration/testdata/test-service.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesMariadbEphemeralTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "mariadb-ephemeral", + "annotations": { + "openshift.io/display-name": "MariaDB (Ephemeral)", + "description": "MariaDB database service, without persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/blob/master/10.1/README.md.\n\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", + "iconClass": "icon-mariadb", + "tags": "database,mariadb", + "template.openshift.io/long-description": "This template provides a standalone MariaDB server with a database created. The database is not stored on persistent storage, so any restart of the service will result in all data being lost. The database name, username, and password are chosen via parameters when provisioning this service.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://github.com/sclorg/mariadb-container/blob/master/10.1/README.md", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Username: ${MYSQL_USER}\n Password: ${MYSQL_PASSWORD}\n Database Name: ${MYSQL_DATABASE}\n Connection URL: mysql://${DATABASE_SERVICE_NAME}:3306/\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/blob/master/10.1/README.md.", + "labels": { + "template": "mariadb-persistent-template" + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "stringData" : { + "database-user" : "${MYSQL_USER}", + "database-password" : "${MYSQL_PASSWORD}", + "database-root-password" : "${MYSQL_ROOT_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "ports": [ + { + "name": "mariadb", + "port": 3306 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "mariadb" + ], + "from": { + "kind": "ImageStreamTag", + "name": "mariadb:10.1", + "namespace": "${NAMESPACE}" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "mariadb", + "image": " ", + "ports": [ + { + "containerPort": 3306 + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 5, + "exec": { + "command": [ "/bin/sh", "-i", "-c", + "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 3306 + } + }, + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-password" + } + } + }, + { + "name": "MYSQL_ROOT_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-root-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/mysql/data" + } + ], + "imagePullPolicy": "IfNotPresent" + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "emptyDir": { + "medium": "" + } + } + ] + } + } + } + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "mariadb", + "required": true + }, + { + "name": "MYSQL_USER", + "displayName": "MariaDB Connection Username", + "description": "Username for MariaDB user that will be used for accessing the database.", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MYSQL_PASSWORD", + "displayName": "MariaDB Connection Password", + "description": "Password for the MariaDB connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MYSQL_ROOT_PASSWORD", + "displayName": "MariaDB root Password", + "description": "Password for the MariaDB root user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MYSQL_DATABASE", + "displayName": "MariaDB Database Name", + "description": "Name of the MariaDB database accessed.", + "value": "sampledb", + "required": true + } + ] +} +`) + +func examplesDbTemplatesMariadbEphemeralTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesMariadbEphemeralTemplateJson, nil +} + +func examplesDbTemplatesMariadbEphemeralTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesMariadbEphemeralTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/mariadb-ephemeral-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesMariadbPersistentTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "mariadb-persistent", + "annotations": { + "openshift.io/display-name": "MariaDB (Persistent)", + "description": "MariaDB database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/blob/master/10.1/README.md.\n\nNOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.", + "iconClass": "icon-mariadb", + "tags": "database,mariadb", + "template.openshift.io/long-description": "This template provides a standalone MariaDB server with a database created. The database is stored on persistent storage. The database name, username, and password are chosen via parameters when provisioning this service.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://github.com/sclorg/mariadb-container/blob/master/10.1/README.md", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Username: ${MYSQL_USER}\n Password: ${MYSQL_PASSWORD}\n Database Name: ${MYSQL_DATABASE}\n Connection URL: mysql://${DATABASE_SERVICE_NAME}:3306/\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/blob/master/10.1/README.md.", + "labels": { + "template": "mariadb-persistent-template" + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "stringData" : { + "database-user" : "${MYSQL_USER}", + "database-password" : "${MYSQL_PASSWORD}", + "database-root-password" : "${MYSQL_ROOT_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "ports": [ + { + "name": "mariadb", + "port": 3306 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + } + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "${VOLUME_CAPACITY}" + } + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "mariadb" + ], + "from": { + "kind": "ImageStreamTag", + "name": "mariadb:10.1", + "namespace": "${NAMESPACE}" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "mariadb", + "image": " ", + "ports": [ + { + "containerPort": 3306 + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 5, + "exec": { + "command": [ "/bin/sh", "-i", "-c", + "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 3306 + } + }, + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-password" + } + } + }, + { + "name": "MYSQL_ROOT_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-root-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/mysql/data" + } + ], + "imagePullPolicy": "IfNotPresent" + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "persistentVolumeClaim": { + "claimName": "${DATABASE_SERVICE_NAME}" + } + } + ] + } + } + } + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "mariadb", + "required": true + }, + { + "name": "MYSQL_USER", + "displayName": "MariaDB Connection Username", + "description": "Username for MariaDB user that will be used for accessing the database.", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MYSQL_PASSWORD", + "displayName": "MariaDB Connection Password", + "description": "Password for the MariaDB connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MYSQL_ROOT_PASSWORD", + "displayName": "MariaDB root Password", + "description": "Password for the MariaDB root user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MYSQL_DATABASE", + "displayName": "MariaDB Database Name", + "description": "Name of the MariaDB database accessed.", + "value": "sampledb", + "required": true + }, + { + "name": "VOLUME_CAPACITY", + "displayName": "Volume Capacity", + "description": "Volume space available for data, e.g. 512Mi, 2Gi.", + "value": "1Gi", + "required": true + } + ] +} +`) + +func examplesDbTemplatesMariadbPersistentTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesMariadbPersistentTemplateJson, nil +} + +func examplesDbTemplatesMariadbPersistentTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesMariadbPersistentTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/mariadb-persistent-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesMongodbEphemeralTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "mongodb-ephemeral", + "creationTimestamp": null, + "annotations": { + "openshift.io/display-name": "MongoDB (Ephemeral)", + "description": "MongoDB database service, without persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/blob/master/3.2/README.md.\n\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", + "iconClass": "icon-mongodb", + "tags": "database,mongodb", + "template.openshift.io/long-description": "This template provides a standalone MongoDB server with a database created. The database is not stored on persistent storage, so any restart of the service will result in all data being lost. The database name, username, and password are chosen via parameters when provisioning this service.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://docs.openshift.org/latest/using_images/db_images/mongodb.html", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Username: ${MONGODB_USER}\n Password: ${MONGODB_PASSWORD}\n Database Name: ${MONGODB_DATABASE}\n Connection URL: mongodb://${MONGODB_USER}:${MONGODB_PASSWORD}@${DATABASE_SERVICE_NAME}/${MONGODB_DATABASE}\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/blob/master/3.2/README.md.", + "labels": { + "template": "mongodb-ephemeral-template" + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "stringData" : { + "database-user" : "${MONGODB_USER}", + "database-password" : "${MONGODB_PASSWORD}", + "database-admin-password" : "${MONGODB_ADMIN_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "mongo", + "protocol": "TCP", + "port": 27017, + "targetPort": 27017, + "nodePort": 0 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "mongodb" + ], + "from": { + "kind": "ImageStreamTag", + "name": "mongodb:${MONGODB_VERSION}", + "namespace": "${NAMESPACE}" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "mongodb", + "image": " ", + "ports": [ + { + "containerPort": 27017, + "protocol": "TCP" + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 3, + "exec": { + "command": [ "/bin/sh", "-i", "-c", "mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 27017 + } + }, + "env": [ + { + "name": "MONGODB_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-user" + } + } + }, + { + "name": "MONGODB_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-password" + } + } + }, + { + "name": "MONGODB_ADMIN_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-admin-password" + } + } + }, + { + "name": "MONGODB_DATABASE", + "value": "${MONGODB_DATABASE}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/mongodb/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "emptyDir": { + "medium": "" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "mongodb", + "required": true + }, + { + "name": "MONGODB_USER", + "displayName": "MongoDB Connection Username", + "description": "Username for MongoDB user that will be used for accessing the database.", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MONGODB_PASSWORD", + "displayName": "MongoDB Connection Password", + "description": "Password for the MongoDB connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MONGODB_DATABASE", + "displayName": "MongoDB Database Name", + "description": "Name of the MongoDB database accessed.", + "value": "sampledb", + "required": true + }, + { + "name": "MONGODB_ADMIN_PASSWORD", + "displayName": "MongoDB Admin Password", + "description": "Password for the database admin user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MONGODB_VERSION", + "displayName": "Version of MongoDB Image", + "description": "Version of MongoDB image to be used (2.4, 2.6, 3.2 or latest).", + "value": "3.2", + "required": true + } + ] +} +`) + +func examplesDbTemplatesMongodbEphemeralTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesMongodbEphemeralTemplateJson, nil +} + +func examplesDbTemplatesMongodbEphemeralTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesMongodbEphemeralTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/mongodb-ephemeral-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesMongodbPersistentTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "mongodb-persistent", + "creationTimestamp": null, + "annotations": { + "openshift.io/display-name": "MongoDB (Persistent)", + "description": "MongoDB database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/blob/master/3.2/README.md.\n\nNOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.", + "iconClass": "icon-mongodb", + "tags": "database,mongodb", + "template.openshift.io/long-description": "This template provides a standalone MongoDB server with a database created. The database is stored on persistent storage. The database name, username, and password are chosen via parameters when provisioning this service.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://docs.openshift.org/latest/using_images/db_images/mongodb.html", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Username: ${MONGODB_USER}\n Password: ${MONGODB_PASSWORD}\n Database Name: ${MONGODB_DATABASE}\n Connection URL: mongodb://${MONGODB_USER}:${MONGODB_PASSWORD}@${DATABASE_SERVICE_NAME}/${MONGODB_DATABASE}\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/blob/master/3.2/README.md.", + "labels": { + "template": "mongodb-persistent-template" + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "stringData" : { + "database-user" : "${MONGODB_USER}", + "database-password" : "${MONGODB_PASSWORD}", + "database-admin-password" : "${MONGODB_ADMIN_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "mongo", + "protocol": "TCP", + "port": 27017, + "targetPort": 27017, + "nodePort": 0 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "${VOLUME_CAPACITY}" + } + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "mongodb" + ], + "from": { + "kind": "ImageStreamTag", + "name": "mongodb:${MONGODB_VERSION}", + "namespace": "${NAMESPACE}" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "mongodb", + "image": " ", + "ports": [ + { + "containerPort": 27017, + "protocol": "TCP" + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 3, + "exec": { + "command": [ "/bin/sh", "-i", "-c", "mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 27017 + } + }, + "env": [ + { + "name": "MONGODB_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-user" + } + } + }, + { + "name": "MONGODB_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-password" + } + } + }, + { + "name": "MONGODB_ADMIN_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-admin-password" + } + } + }, + { + "name": "MONGODB_DATABASE", + "value": "${MONGODB_DATABASE}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/mongodb/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "persistentVolumeClaim": { + "claimName": "${DATABASE_SERVICE_NAME}" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "mongodb", + "required": true + }, + { + "name": "MONGODB_USER", + "displayName": "MongoDB Connection Username", + "description": "Username for MongoDB user that will be used for accessing the database.", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MONGODB_PASSWORD", + "displayName": "MongoDB Connection Password", + "description": "Password for the MongoDB connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MONGODB_DATABASE", + "displayName": "MongoDB Database Name", + "description": "Name of the MongoDB database accessed.", + "value": "sampledb", + "required": true + }, + { + "name": "MONGODB_ADMIN_PASSWORD", + "displayName": "MongoDB Admin Password", + "description": "Password for the database admin user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "VOLUME_CAPACITY", + "displayName": "Volume Capacity", + "description": "Volume space available for data, e.g. 512Mi, 2Gi.", + "value": "1Gi", + "required": true + }, + { + "name": "MONGODB_VERSION", + "displayName": "Version of MongoDB Image", + "description": "Version of MongoDB image to be used (2.4, 2.6, 3.2 or latest).", + "value": "3.2", + "required": true + } + ] +} +`) + +func examplesDbTemplatesMongodbPersistentTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesMongodbPersistentTemplateJson, nil +} + +func examplesDbTemplatesMongodbPersistentTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesMongodbPersistentTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/mongodb-persistent-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesMysqlEphemeralTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "mysql-ephemeral", + "annotations": { + "openshift.io/display-name": "MySQL (Ephemeral)", + "description": "MySQL database service, without persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mysql-container/blob/master/5.7/README.md.\n\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", + "iconClass": "icon-mysql-database", + "tags": "database,mysql", + "template.openshift.io/long-description": "This template provides a standalone MySQL server with a database created. The database is not stored on persistent storage, so any restart of the service will result in all data being lost. The database name, username, and password are chosen via parameters when provisioning this service.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://docs.openshift.org/latest/using_images/db_images/mysql.html", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Username: ${MYSQL_USER}\n Password: ${MYSQL_PASSWORD}\n Database Name: ${MYSQL_DATABASE}\n Connection URL: mysql://${DATABASE_SERVICE_NAME}:3306/\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mysql-container/blob/master/5.7/README.md.", + "labels": { + "template": "mysql-ephemeral-template" + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "stringData" : { + "database-user" : "${MYSQL_USER}", + "database-password" : "${MYSQL_PASSWORD}", + "database-root-password" : "${MYSQL_ROOT_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "mysql", + "protocol": "TCP", + "port": 3306, + "targetPort": 3306, + "nodePort": 0 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "mysql" + ], + "from": { + "kind": "ImageStreamTag", + "name": "mysql:${MYSQL_VERSION}", + "namespace": "${NAMESPACE}" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "mysql", + "image": " ", + "ports": [ + { + "containerPort": 3306, + "protocol": "TCP" + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 5, + "exec": { + "command": [ "/bin/sh", "-i", "-c", + "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 3306 + } + }, + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-password" + } + } + }, + { + "name": "MYSQL_ROOT_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-root-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/mysql/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "emptyDir": { + "medium": "" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "mysql", + "required": true + }, + { + "name": "MYSQL_USER", + "displayName": "MySQL Connection Username", + "description": "Username for MySQL user that will be used for accessing the database.", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MYSQL_PASSWORD", + "displayName": "MySQL Connection Password", + "description": "Password for the MySQL connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MYSQL_ROOT_PASSWORD", + "displayName": "MySQL root user Password", + "description": "Password for the MySQL root user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MYSQL_DATABASE", + "displayName": "MySQL Database Name", + "description": "Name of the MySQL database accessed.", + "value": "sampledb", + "required": true + }, + { + "name": "MYSQL_VERSION", + "displayName": "Version of MySQL Image", + "description": "Version of MySQL image to be used (5.5, 5.6, 5.7, or latest).", + "value": "5.7", + "required": true + } + ] +} +`) + +func examplesDbTemplatesMysqlEphemeralTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesMysqlEphemeralTemplateJson, nil +} + +func examplesDbTemplatesMysqlEphemeralTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesMysqlEphemeralTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/mysql-ephemeral-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesMysqlPersistentTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "mysql-persistent", + "annotations": { + "openshift.io/display-name": "MySQL (Persistent)", + "description": "MySQL database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mysql-container/blob/master/5.7/README.md.\n\nNOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.", + "iconClass": "icon-mysql-database", + "tags": "database,mysql", + "template.openshift.io/long-description": "This template provides a standalone MySQL server with a database created. The database is stored on persistent storage. The database name, username, and password are chosen via parameters when provisioning this service.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://docs.openshift.org/latest/using_images/db_images/mysql.html", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Username: ${MYSQL_USER}\n Password: ${MYSQL_PASSWORD}\n Database Name: ${MYSQL_DATABASE}\n Connection URL: mysql://${DATABASE_SERVICE_NAME}:3306/\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mysql-container/blob/master/5.7/README.md.", + "labels": { + "template": "mysql-persistent-template" + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "stringData" : { + "database-user" : "${MYSQL_USER}", + "database-password" : "${MYSQL_PASSWORD}", + "database-root-password" : "${MYSQL_ROOT_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "ports": [ + { + "name": "mysql", + "port": 3306 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + } + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "${VOLUME_CAPACITY}" + } + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "mysql" + ], + "from": { + "kind": "ImageStreamTag", + "name": "mysql:${MYSQL_VERSION}", + "namespace": "${NAMESPACE}" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "mysql", + "image": " ", + "ports": [ + { + "containerPort": 3306 + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 5, + "exec": { + "command": [ "/bin/sh", "-i", "-c", + "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 3306 + } + }, + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-password" + } + } + }, + { + "name": "MYSQL_ROOT_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-root-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/mysql/data" + } + ], + "imagePullPolicy": "IfNotPresent" + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "persistentVolumeClaim": { + "claimName": "${DATABASE_SERVICE_NAME}" + } + } + ] + } + } + } + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "mysql", + "required": true + }, + { + "name": "MYSQL_USER", + "displayName": "MySQL Connection Username", + "description": "Username for MySQL user that will be used for accessing the database.", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MYSQL_PASSWORD", + "displayName": "MySQL Connection Password", + "description": "Password for the MySQL connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MYSQL_ROOT_PASSWORD", + "displayName": "MySQL root user Password", + "description": "Password for the MySQL root user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "MYSQL_DATABASE", + "displayName": "MySQL Database Name", + "description": "Name of the MySQL database accessed.", + "value": "sampledb", + "required": true + }, + { + "name": "VOLUME_CAPACITY", + "displayName": "Volume Capacity", + "description": "Volume space available for data, e.g. 512Mi, 2Gi.", + "value": "1Gi", + "required": true + }, + { + "name": "MYSQL_VERSION", + "displayName": "Version of MySQL Image", + "description": "Version of MySQL image to be used (5.5, 5.6, 5.7, or latest).", + "value": "5.7", + "required": true + } + ] +} +`) + +func examplesDbTemplatesMysqlPersistentTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesMysqlPersistentTemplateJson, nil +} + +func examplesDbTemplatesMysqlPersistentTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesMysqlPersistentTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/mysql-persistent-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesPostgresqlEphemeralTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "postgresql-ephemeral", + "creationTimestamp": null, + "annotations": { + "openshift.io/display-name": "PostgreSQL (Ephemeral)", + "description": "PostgreSQL database service, without persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/blob/master/9.5.\n\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", + "iconClass": "icon-postgresql", + "tags": "database,postgresql", + "template.openshift.io/long-description": "This template provides a standalone PostgreSQL server with a database created. The database is not stored on persistent storage, so any restart of the service will result in all data being lost. The database name, username, and password are chosen via parameters when provisioning this service.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://docs.openshift.org/latest/using_images/db_images/postgresql.html", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Username: ${POSTGRESQL_USER}\n Password: ${POSTGRESQL_PASSWORD}\n Database Name: ${POSTGRESQL_DATABASE}\n Connection URL: postgresql://${DATABASE_SERVICE_NAME}:5432/\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/blob/master/9.5.", + "labels": { + "template": "postgresql-ephemeral-template" + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "stringData" : { + "database-user" : "${POSTGRESQL_USER}", + "database-password" : "${POSTGRESQL_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "postgresql", + "protocol": "TCP", + "port": 5432, + "targetPort": 5432, + "nodePort": 0 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "postgresql" + ], + "from": { + "kind": "ImageStreamTag", + "name": "postgresql:${POSTGRESQL_VERSION}", + "namespace": "${NAMESPACE}" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "postgresql", + "image": " ", + "ports": [ + { + "containerPort": 5432, + "protocol": "TCP" + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 5, + "exec": { + "command": [ "/bin/sh", "-i", "-c", "psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1'"] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 5432 + } + }, + "env": [ + { + "name": "POSTGRESQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-user" + } + } + }, + { + "name": "POSTGRESQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-password" + } + } + }, + { + "name": "POSTGRESQL_DATABASE", + "value": "${POSTGRESQL_DATABASE}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/pgsql/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "emptyDir": { + "medium": "" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "postgresql", + "required": true + }, + { + "name": "POSTGRESQL_USER", + "displayName": "PostgreSQL Connection Username", + "description": "Username for PostgreSQL user that will be used for accessing the database.", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "POSTGRESQL_PASSWORD", + "displayName": "PostgreSQL Connection Password", + "description": "Password for the PostgreSQL connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "POSTGRESQL_DATABASE", + "displayName": "PostgreSQL Database Name", + "description": "Name of the PostgreSQL database accessed.", + "value": "sampledb", + "required": true + }, + { + "name": "POSTGRESQL_VERSION", + "displayName": "Version of PostgreSQL Image", + "description": "Version of PostgreSQL image to be used (9.2, 9.4, 9.5 or latest).", + "value": "9.5", + "required": true + } + ] +} +`) + +func examplesDbTemplatesPostgresqlEphemeralTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesPostgresqlEphemeralTemplateJson, nil +} + +func examplesDbTemplatesPostgresqlEphemeralTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesPostgresqlEphemeralTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/postgresql-ephemeral-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesPostgresqlPersistentTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "postgresql-persistent", + "creationTimestamp": null, + "annotations": { + "openshift.io/display-name": "PostgreSQL (Persistent)", + "description": "PostgreSQL database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/blob/master/9.5.\n\nNOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.", + "iconClass": "icon-postgresql", + "tags": "database,postgresql", + "template.openshift.io/long-description": "This template provides a standalone PostgreSQL server with a database created. The database is stored on persistent storage. The database name, username, and password are chosen via parameters when provisioning this service.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://docs.openshift.org/latest/using_images/db_images/postgresql.html", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Username: ${POSTGRESQL_USER}\n Password: ${POSTGRESQL_PASSWORD}\n Database Name: ${POSTGRESQL_DATABASE}\n Connection URL: postgresql://${DATABASE_SERVICE_NAME}:5432/\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/blob/master/9.5.", + "labels": { + "template": "postgresql-persistent-template" + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "stringData" : { + "database-user" : "${POSTGRESQL_USER}", + "database-password" : "${POSTGRESQL_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "postgresql", + "protocol": "TCP", + "port": 5432, + "targetPort": 5432, + "nodePort": 0 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "${VOLUME_CAPACITY}" + } + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "postgresql" + ], + "from": { + "kind": "ImageStreamTag", + "name": "postgresql:${POSTGRESQL_VERSION}", + "namespace": "${NAMESPACE}" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "postgresql", + "image": " ", + "ports": [ + { + "containerPort": 5432, + "protocol": "TCP" + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 5, + "exec": { + "command": [ "/bin/sh", "-i", "-c", "psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1'"] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 5432 + } + }, + "env": [ + { + "name": "POSTGRESQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-user" + } + } + }, + { + "name": "POSTGRESQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "${DATABASE_SERVICE_NAME}", + "key" : "database-password" + } + } + }, + { + "name": "POSTGRESQL_DATABASE", + "value": "${POSTGRESQL_DATABASE}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/pgsql/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "persistentVolumeClaim": { + "claimName": "${DATABASE_SERVICE_NAME}" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "postgresql", + "required": true + }, + { + "name": "POSTGRESQL_USER", + "displayName": "PostgreSQL Connection Username", + "description": "Username for PostgreSQL user that will be used for accessing the database.", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "POSTGRESQL_PASSWORD", + "displayName": "PostgreSQL Connection Password", + "description": "Password for the PostgreSQL connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "POSTGRESQL_DATABASE", + "displayName": "PostgreSQL Database Name", + "description": "Name of the PostgreSQL database accessed.", + "value": "sampledb", + "required": true + }, + { + "name": "VOLUME_CAPACITY", + "displayName": "Volume Capacity", + "description": "Volume space available for data, e.g. 512Mi, 2Gi.", + "value": "1Gi", + "required": true + }, + { + "name": "POSTGRESQL_VERSION", + "displayName": "Version of PostgreSQL Image", + "description": "Version of PostgreSQL image to be used (9.2, 9.4, 9.5 or latest).", + "value": "9.5", + "required": true + } + ] +} +`) + +func examplesDbTemplatesPostgresqlPersistentTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesPostgresqlPersistentTemplateJson, nil +} + +func examplesDbTemplatesPostgresqlPersistentTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesPostgresqlPersistentTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/postgresql-persistent-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesRedisEphemeralTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "redis-ephemeral", + "creationTimestamp": null, + "annotations": { + "openshift.io/display-name": "Redis (Ephemeral)", + "description": "Redis in-memory data structure store, without persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/redis-container/blob/master/3.2.\n\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", + "iconClass": "icon-redis", + "tags": "database,redis", + "template.openshift.io/long-description": "This template provides a standalone Redis server. The data is not stored on persistent storage, so any restart of the service will result in all data being lost.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://github.com/sclorg/redis-container/tree/master/3.2", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Password: ${REDIS_PASSWORD}\n Connection URL: redis://${DATABASE_SERVICE_NAME}:6379/\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/redis-container/blob/master/3.2.", + "labels": { + "template": "redis-ephemeral-template" + }, + "objects": [ + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "redis", + "protocol": "TCP", + "port": 6379, + "targetPort": 6379, + "nodePort": 0 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "redis" + ], + "from": { + "kind": "ImageStreamTag", + "name": "redis:${REDIS_VERSION}", + "namespace": "${NAMESPACE}" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "redis", + "image": " ", + "ports": [ + { + "containerPort": 6379, + "protocol": "TCP" + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 5, + "exec": { + "command": [ "/bin/sh", "-i", "-c", "test \"$(redis-cli -h 127.0.0.1 -a $REDIS_PASSWORD ping)\" == \"PONG\""] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 6379 + } + }, + "env": [ + { + "name": "REDIS_PASSWORD", + "value": "${REDIS_PASSWORD}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/redis/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "emptyDir": { + "medium": "" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "redis", + "required": true + }, + { + "name": "REDIS_PASSWORD", + "displayName": "Redis Connection Password", + "description": "Password for the Redis connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "REDIS_VERSION", + "displayName": "Version of Redis Image", + "description": "Version of Redis image to be used (3.2 or latest).", + "value": "3.2", + "required": true + } + ] +} +`) + +func examplesDbTemplatesRedisEphemeralTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesRedisEphemeralTemplateJson, nil +} + +func examplesDbTemplatesRedisEphemeralTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesRedisEphemeralTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/redis-ephemeral-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesDbTemplatesRedisPersistentTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "redis-persistent", + "creationTimestamp": null, + "annotations": { + "openshift.io/display-name": "Redis (Persistent)", + "description": "Redis in-memory data structure store, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/redis-container/blob/master/3.2.\n\nNOTE: You must have persistent volumes available in your cluster to use this template.", + "iconClass": "icon-redis", + "tags": "database,redis", + "template.openshift.io/long-description": "This template provides a standalone Redis server. The data is stored on persistent storage.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://github.com/sclorg/redis-container/tree/master/3.2", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}.\n\n Password: ${REDIS_PASSWORD}\n Connection URL: redis://${DATABASE_SERVICE_NAME}:6379/\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/redis-container/blob/master/3.2.", + "labels": { + "template": "redis-persistent-template" + }, + "objects": [ + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "redis", + "protocol": "TCP", + "port": 6379, + "targetPort": 6379, + "nodePort": 0 + } + ], + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "${VOLUME_CAPACITY}" + } + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${DATABASE_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "redis" + ], + "from": { + "kind": "ImageStreamTag", + "name": "redis:${REDIS_VERSION}", + "namespace": "${NAMESPACE}" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${DATABASE_SERVICE_NAME}" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "${DATABASE_SERVICE_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "redis", + "image": " ", + "ports": [ + { + "containerPort": 6379, + "protocol": "TCP" + } + ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 5, + "exec": { + "command": [ "/bin/sh", "-i", "-c", "test \"$(redis-cli -h 127.0.0.1 -a $REDIS_PASSWORD ping)\" == \"PONG\""] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 6379 + } + }, + "env": [ + { + "name": "REDIS_PASSWORD", + "value": "${REDIS_PASSWORD}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "mountPath": "/var/lib/redis/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "${DATABASE_SERVICE_NAME}-data", + "persistentVolumeClaim": { + "claimName": "${DATABASE_SERVICE_NAME}" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "DATABASE_SERVICE_NAME", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", + "value": "redis", + "required": true + }, + { + "name": "REDIS_PASSWORD", + "displayName": "Redis Connection Password", + "description": "Password for the Redis connection user.", + "generate": "expression", + "from": "[a-zA-Z0-9]{16}", + "required": true + }, + { + "name": "VOLUME_CAPACITY", + "displayName": "Volume Capacity", + "description": "Volume space available for data, e.g. 512Mi, 2Gi.", + "value": "1Gi", + "required": true + }, + { + "name": "REDIS_VERSION", + "displayName": "Version of Redis Image", + "description": "Version of Redis image to be used (3.2 or latest).", + "value": "3.2", + "required": true + } + ] +} +`) + +func examplesDbTemplatesRedisPersistentTemplateJsonBytes() ([]byte, error) { + return _examplesDbTemplatesRedisPersistentTemplateJson, nil +} + +func examplesDbTemplatesRedisPersistentTemplateJson() (*asset, error) { + bytes, err := examplesDbTemplatesRedisPersistentTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/db-templates/redis-persistent-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesImageStreamsImageStreamsCentos7Json = []byte(`{ + "kind": "ImageStreamList", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "ruby", + "annotations": { + "openshift.io/display-name": "Ruby" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Ruby (Latest)", + "description": "Build and run Ruby applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/tree/master/2.3/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Ruby available on OpenShift, including major versions updates.", + "iconClass": "icon-ruby", + "tags": "builder,ruby", + "supports": "ruby", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "2.3" + } + }, + { + "name": "2.0", + "annotations": { + "openshift.io/display-name": "Ruby 2.0", + "description": "Build and run Ruby 2.0 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/tree/master/2.0/README.md.", + "iconClass": "icon-ruby", + "tags": "hidden,builder,ruby", + "supports": "ruby:2.0,ruby", + "version": "2.0", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/ruby-20-centos7:latest" + } + }, + { + "name": "2.2", + "annotations": { + "openshift.io/display-name": "Ruby 2.2", + "description": "Build and run Ruby 2.2 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/tree/master/2.2/README.md.", + "iconClass": "icon-ruby", + "tags": "builder,ruby", + "supports": "ruby:2.2,ruby", + "version": "2.2", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7:latest" + } + }, + { + "name": "2.3", + "annotations": { + "openshift.io/display-name": "Ruby 2.3", + "description": "Build and run Ruby 2.3 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/blob/master/2.3/README.md.", + "iconClass": "icon-ruby", + "tags": "builder,ruby", + "supports": "ruby:2.3,ruby", + "version": "2.3", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/ruby-23-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "nodejs", + "annotations": { + "openshift.io/display-name": "Node.js" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Node.js (Latest)", + "description": "Build and run Node.js applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Node.js available on OpenShift, including major versions updates.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "supports":"nodejs", + "sampleRepo": "https://github.com/openshift/nodejs-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "4" + } + }, + { + "name": "0.10", + "annotations": { + "openshift.io/display-name": "Node.js 0.10", + "description": "DEPRECATED: Build and run Node.js 0.10 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/0.10/README.md.", + "iconClass": "icon-nodejs", + "tags": "hidden,nodejs", + "supports":"nodejs:0.10,nodejs:0.1,nodejs", + "version": "0.10", + "sampleRepo": "https://github.com/openshift/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/nodejs-010-centos7:latest" + } + }, + { + "name": "4", + "annotations": { + "openshift.io/display-name": "Node.js 4", + "description": "Build and run Node.js 4 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/4/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "supports":"nodejs:4,nodejs", + "version": "4", + "sampleRepo": "https://github.com/openshift/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/nodejs-4-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "perl", + "annotations": { + "openshift.io/display-name": "Perl" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Perl (Latest)", + "description": "Build and run Perl applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-perl-container/blob/master/5.20/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Perl available on OpenShift, including major versions updates.", + "iconClass": "icon-perl", + "tags": "builder,perl", + "supports":"perl", + "sampleRepo": "https://github.com/openshift/dancer-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "5.24" + } + }, + { + "name": "5.16", + "annotations": { + "openshift.io/display-name": "Perl 5.16", + "description": "Build and run Perl 5.16 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-perl-container/blob/master/5.16/README.md.", + "iconClass": "icon-perl", + "tags": "hidden,builder,perl", + "supports":"perl:5.16,perl", + "version": "5.16", + "sampleRepo": "https://github.com/openshift/dancer-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/perl-516-centos7:latest" + } + }, + { + "name": "5.20", + "annotations": { + "openshift.io/display-name": "Perl 5.20", + "description": "Build and run Perl 5.20 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-perl-container/blob/master/5.20/README.md.", + "iconClass": "icon-perl", + "tags": "builder,perl", + "supports":"perl:5.20,perl", + "version": "5.20", + "sampleRepo": "https://github.com/openshift/dancer-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/perl-520-centos7:latest" + } + }, + { + "name": "5.24", + "annotations": { + "openshift.io/display-name": "Perl 5.24", + "description": "Build and run Perl 5.24 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-perl-container/blob/master/5.24/README.md.", + "iconClass": "icon-perl", + "tags": "builder,perl", + "supports":"perl:5.24,perl", + "version": "5.24", + "sampleRepo": "https://github.com/openshift/dancer-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/perl-524-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "php", + "annotations": { + "openshift.io/display-name": "PHP" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "PHP (Latest)", + "description": "Build and run PHP applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/5.6/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of PHP available on OpenShift, including major versions updates.", + "iconClass": "icon-php", + "tags": "builder,php", + "supports":"php", + "sampleRepo": "https://github.com/openshift/cakephp-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "7.0" + } + }, + { + "name": "5.5", + "annotations": { + "openshift.io/display-name": "PHP 5.5", + "description": "Build and run PHP 5.5 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/5.5/README.md.", + "iconClass": "icon-php", + "tags": "hidden,builder,php", + "supports":"php:5.5,php", + "version": "5.5", + "sampleRepo": "https://github.com/openshift/cakephp-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/php-55-centos7:latest" + } + }, + { + "name": "5.6", + "annotations": { + "openshift.io/display-name": "PHP 5.6", + "description": "Build and run PHP 5.6 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/5.6/README.md.", + "iconClass": "icon-php", + "tags": "builder,php", + "supports":"php:5.6,php", + "version": "5.6", + "sampleRepo": "https://github.com/openshift/cakephp-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/php-56-centos7:latest" + } + }, + { + "name": "7.0", + "annotations": { + "openshift.io/display-name": "PHP 7.0", + "description": "Build and run PHP 7.0 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/7.0/README.md.", + "iconClass": "icon-php", + "tags": "builder,php", + "supports":"php:7.0,php", + "version": "7.0", + "sampleRepo": "https://github.com/openshift/cakephp-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/php-70-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "python", + "annotations": { + "openshift.io/display-name": "Python" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Python (Latest)", + "description": "Build and run Python applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.5/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Python available on OpenShift, including major versions updates.", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "3.5" + } + }, + { + "name": "3.3", + "annotations": { + "openshift.io/display-name": "Python 3.3", + "description": "Build and run Python 3.3 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.3/README.md.", + "iconClass": "icon-python", + "tags": "hidden,builder,python", + "supports":"python:3.3,python", + "version": "3.3", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/python-33-centos7:latest" + } + }, + { + "name": "2.7", + "annotations": { + "openshift.io/display-name": "Python 2.7", + "description": "Build and run Python 2.7 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/2.7/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python:2.7,python", + "version": "2.7", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/python-27-centos7:latest" + } + }, + { + "name": "3.4", + "annotations": { + "openshift.io/display-name": "Python 3.4", + "description": "Build and run Python 3.4 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.4/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python:3.4,python", + "version": "3.4", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/python-34-centos7:latest" + } + }, + { + "name": "3.5", + "annotations": { + "openshift.io/display-name": "Python 3.5", + "description": "Build and run Python 3.5 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.5/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python:3.5,python", + "version": "3.5", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "centos/python-35-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "wildfly", + "annotations": { + "openshift.io/display-name": "WildFly" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "WildFly (Latest)", + "description": "Build and run WildFly applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of WildFly available on OpenShift, including major versions updates.", + "iconClass": "icon-wildfly", + "tags": "builder,wildfly,java", + "supports":"jee,java", + "sampleRepo": "https://github.com/bparees/openshift-jee-sample.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "10.1" + } + }, + { + "name": "8.1", + "annotations": { + "openshift.io/display-name": "WildFly 8.1", + "description": "Build and run WildFly 8.1 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md.", + "iconClass": "icon-wildfly", + "tags": "builder,wildfly,java", + "supports":"wildfly:8.1,jee,java", + "version": "8.1", + "sampleRepo": "https://github.com/bparees/openshift-jee-sample.git" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/wildfly-81-centos7:latest" + } + }, + { + "name": "9.0", + "annotations": { + "openshift.io/display-name": "WildFly 9.0", + "description": "Build and run WildFly 9.0 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md.", + "iconClass": "icon-wildfly", + "tags": "builder,wildfly,java", + "supports":"wildfly:9.0,jee,java", + "version": "9.0", + "sampleRepo": "https://github.com/bparees/openshift-jee-sample.git" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/wildfly-90-centos7:latest" + } + }, + { + "name": "10.0", + "annotations": { + "openshift.io/display-name": "WildFly 10.0", + "description": "Build and run WildFly 10.0 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md.", + "iconClass": "icon-wildfly", + "tags": "builder,wildfly,java", + "supports":"wildfly:10.0,jee,java", + "version": "10.0", + "sampleRepo": "https://github.com/bparees/openshift-jee-sample.git" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/wildfly-100-centos7:latest" + } + }, + { + "name": "10.1", + "annotations": { + "openshift.io/display-name": "WildFly 10.1", + "description": "Build and run WildFly 10.1 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md.", + "iconClass": "icon-wildfly", + "tags": "builder,wildfly,java", + "supports":"wildfly:10.1,jee,java", + "version": "10.1", + "sampleRepo": "https://github.com/bparees/openshift-jee-sample.git" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/wildfly-101-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "mysql", + "annotations": { + "openshift.io/display-name": "MySQL" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "MySQL (Latest)", + "description": "Provides a MySQL database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mysql-container/tree/master/5.6/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of MySQL available on OpenShift, including major versions updates.", + "iconClass": "icon-mysql-database", + "tags": "mysql" + }, + "from": { + "kind": "ImageStreamTag", + "name": "5.7" + } + }, + { + "name": "5.5", + "annotations": { + "openshift.io/display-name": "MySQL 5.5", + "description": "Provides a MySQL 5.5 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mysql-container/tree/master/5.5/README.md.", + "iconClass": "icon-mysql-database", + "tags": "hidden,mysql", + "version": "5.5" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/mysql-55-centos7:latest" + } + }, + { + "name": "5.6", + "annotations": { + "openshift.io/display-name": "MySQL 5.6", + "description": "Provides a MySQL 5.6 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mysql-container/tree/master/5.6/README.md.", + "iconClass": "icon-mysql-database", + "tags": "mysql", + "version": "5.6" + }, + "from": { + "kind": "DockerImage", + "name": "centos/mysql-56-centos7:latest" + } + }, + { + "name": "5.7", + "annotations": { + "openshift.io/display-name": "MySQL 5.7", + "description": "Provides a MySQL 5.7 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mysql-container/tree/master/5.7/README.md.", + "iconClass": "icon-mysql-database", + "tags": "mysql", + "version": "5.7" + }, + "from": { + "kind": "DockerImage", + "name": "centos/mysql-57-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "mariadb", + "annotations": { + "openshift.io/display-name": "MariaDB" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "MariaDB (Latest)", + "description": "Provides a MariaDB database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.1/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of MariaDB available on OpenShift, including major versions updates.", + "iconClass": "icon-mariadb", + "tags": "mariadb" + }, + "from": { + "kind": "ImageStreamTag", + "name": "10.1" + } + }, + { + "name": "10.1", + "annotations": { + "openshift.io/display-name": "MariaDB 10.1", + "description": "Provides a MariaDB 10.1 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.1/README.md.", + "iconClass": "icon-mariadb", + "tags": "mariadb", + "version": "10.1" + }, + "from": { + "kind": "DockerImage", + "name": "centos/mariadb-101-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "postgresql", + "annotations": { + "openshift.io/display-name": "PostgreSQL" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "PostgreSQL (Latest)", + "description": "Provides a PostgreSQL database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/tree/master/9.5.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of PostgreSQL available on OpenShift, including major versions updates.", + "iconClass": "icon-postgresql", + "tags": "postgresql" + }, + "from": { + "kind": "ImageStreamTag", + "name": "9.5" + } + }, + { + "name": "9.2", + "annotations": { + "openshift.io/display-name": "PostgreSQL 9.2", + "description": "Provides a PostgreSQL 9.2 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/tree/master/9.2.", + "iconClass": "icon-postgresql", + "tags": "hidden,postgresql", + "version": "9.2" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/postgresql-92-centos7:latest" + } + }, + { + "name": "9.4", + "annotations": { + "openshift.io/display-name": "PostgreSQL 9.4", + "description": "Provides a PostgreSQL 9.4 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/tree/master/9.4.", + "iconClass": "icon-postgresql", + "tags": "postgresql", + "version": "9.4" + }, + "from": { + "kind": "DockerImage", + "name": "centos/postgresql-94-centos7:latest" + } + }, + { + "name": "9.5", + "annotations": { + "openshift.io/display-name": "PostgreSQL 9.5", + "description": "Provides a PostgreSQL 9.5 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/tree/master/9.5.", + "iconClass": "icon-postgresql", + "tags": "postgresql", + "version": "9.5" + }, + "from": { + "kind": "DockerImage", + "name": "centos/postgresql-95-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "mongodb", + "annotations": { + "openshift.io/display-name": "MongoDB" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "MongoDB (Latest)", + "description": "Provides a MongoDB database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/tree/master/3.2/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of MongoDB available on OpenShift, including major versions updates.", + "iconClass": "icon-mongodb", + "tags": "mongodb" + }, + "from": { + "kind": "ImageStreamTag", + "name": "3.2" + } + }, + { + "name": "2.4", + "annotations": { + "openshift.io/display-name": "MongoDB 2.4", + "description": "Provides a MongoDB 2.4 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/tree/master/2.4/README.md.", + "iconClass": "icon-mongodb", + "tags": "hidden,mongodb", + "version": "2.4" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/mongodb-24-centos7:latest" + } + }, + { + "name": "2.6", + "annotations": { + "openshift.io/display-name": "MongoDB 2.6", + "description": "Provides a MongoDB 2.6 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/tree/master/2.6/README.md.", + "iconClass": "icon-mongodb", + "tags": "mongodb", + "version": "2.6" + }, + "from": { + "kind": "DockerImage", + "name": "centos/mongodb-26-centos7:latest" + } + }, + { + "name": "3.2", + "annotations": { + "openshift.io/display-name": "MongoDB 3.2", + "description": "Provides a MongoDB 3.2 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/tree/master/3.2/README.md.", + "iconClass": "icon-mongodb", + "tags": "mongodb", + "version": "3.2" + }, + "from": { + "kind": "DockerImage", + "name": "centos/mongodb-32-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "redis", + "annotations": { + "openshift.io/display-name": "Redis" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Redis (Latest)", + "description": "Provides a Redis database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/redis-container/tree/master/3.2/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Redis available on OpenShift, including major versions updates.", + "iconClass": "icon-redis", + "tags": "redis" + }, + "from": { + "kind": "ImageStreamTag", + "name": "3.2" + } + }, + { + "name": "3.2", + "annotations": { + "openshift.io/display-name": "Redis 3.2", + "description": "Provides a Redis 3.2 database on CentOS 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/redis-container/tree/master/3.2/README.md.", + "iconClass": "icon-redis", + "tags": "redis", + "version": "3.2" + }, + "from": { + "kind": "DockerImage", + "name": "centos/redis-32-centos7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "jenkins", + "annotations": { + "openshift.io/display-name": "Jenkins" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Jenkins (Latest)", + "description": "Provides a Jenkins server on CentOS 7. For more information about using this container image, including OpenShift considerations, see https://github.com/openshift/jenkins/blob/master/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Jenkins available on OpenShift, including major versions updates.", + "iconClass": "icon-jenkins", + "tags": "jenkins" + }, + "from": { + "kind": "ImageStreamTag", + "name": "2" + } + }, + { + "name": "1", + "annotations": { + "openshift.io/display-name": "Jenkins 1.X", + "description": "Provides a Jenkins 1.X server on CentOS 7. For more information about using this container image, including OpenShift considerations, see https://github.com/openshift/jenkins/blob/master/README.md.", + "iconClass": "icon-jenkins", + "tags": "jenkins", + "version": "1.x" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/jenkins-1-centos7:latest" + } + }, + { + "name": "2", + "annotations": { + "openshift.io/display-name": "Jenkins 2.X", + "description": "Provides a Jenkins v2.x server on CentOS 7. For more information about using this container image, including OpenShift considerations, see https://github.com/openshift/jenkins/blob/master/README.md.", + "iconClass": "icon-jenkins", + "tags": "jenkins", + "version": "2.x" + }, + "from": { + "kind": "DockerImage", + "name": "openshift/jenkins-2-centos7:latest" + } + } + ] + } + } + ] +} +`) + +func examplesImageStreamsImageStreamsCentos7JsonBytes() ([]byte, error) { + return _examplesImageStreamsImageStreamsCentos7Json, nil +} + +func examplesImageStreamsImageStreamsCentos7Json() (*asset, error) { + bytes, err := examplesImageStreamsImageStreamsCentos7JsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/image-streams/image-streams-centos7.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesImageStreamsImageStreamsRhel7Json = []byte(`{ + "kind": "ImageStreamList", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "ruby", + "annotations": { + "openshift.io/display-name": "Ruby" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Ruby (Latest)", + "description": "Build and run Ruby applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/tree/master/2.3/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Ruby available on OpenShift, including major versions updates.", + "iconClass": "icon-ruby", + "tags": "builder,ruby", + "supports": "ruby", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "2.3" + } + }, + { + "name": "2.0", + "annotations": { + "openshift.io/display-name": "Ruby 2.0", + "description": "Build and run Ruby 2.0 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/tree/master/2.0/README.md.", + "iconClass": "icon-ruby", + "tags": "hidden,builder,ruby", + "supports": "ruby:2.0,ruby", + "version": "2.0", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/ruby-20-rhel7:latest" + } + }, + { + "name": "2.2", + "annotations": { + "openshift.io/display-name": "Ruby 2.2", + "description": "Build and run Ruby 2.2 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/tree/master/2.2/README.md.", + "iconClass": "icon-ruby", + "tags": "builder,ruby", + "supports": "ruby:2.2,ruby", + "version": "2.2", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/ruby-22-rhel7:latest" + } + }, + { + "name": "2.3", + "annotations": { + "openshift.io/display-name": "Ruby 2.3", + "description": "Build and run Ruby 2.3 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/blob/master/2.3/README.md.", + "iconClass": "icon-ruby", + "tags": "builder,ruby", + "supports": "ruby:2.3,ruby", + "version": "2.3", + "sampleRepo": "https://github.com/openshift/ruby-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/ruby-23-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "nodejs", + "annotations": { + "openshift.io/display-name": "Node.js" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Node.js (Latest)", + "description": "Build and run Node.js applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Node.js available on OpenShift, including major versions updates.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "supports":"nodejs", + "sampleRepo": "https://github.com/openshift/nodejs-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "4" + } + }, + { + "name": "0.10", + "annotations": { + "openshift.io/display-name": "Node.js 0.10", + "description": "DEPRECATED: Build and run Node.js 0.10 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/0.10/README.md.", + "iconClass": "icon-nodejs", + "tags": "hidden,nodejs", + "supports":"nodejs:0.10,nodejs:0.1,nodejs", + "version": "0.10", + "sampleRepo": "https://github.com/openshift/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/nodejs-010-rhel7:latest" + } + }, + { + "name": "4", + "annotations": { + "openshift.io/display-name": "Node.js 4", + "description": "Build and run Node.js 4 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/4/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "supports":"nodejs:4,nodejs", + "version": "4", + "sampleRepo": "https://github.com/openshift/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/nodejs-4-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "perl", + "annotations": { + "openshift.io/display-name": "Perl" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Perl (Latest)", + "description": "Build and run Perl applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-perl-container/blob/master/5.20/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Perl available on OpenShift, including major versions updates.", + "iconClass": "icon-perl", + "tags": "builder,perl", + "supports":"perl", + "sampleRepo": "https://github.com/openshift/dancer-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "5.24" + } + }, + { + "name": "5.16", + "annotations": { + "openshift.io/display-name": "Perl 5.16", + "description": "Build and run Perl 5.16 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-perl-container/blob/master/5.16/README.md.", + "iconClass": "icon-perl", + "tags": "hidden,builder,perl", + "supports":"perl:5.16,perl", + "version": "5.16", + "sampleRepo": "https://github.com/openshift/dancer-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/perl-516-rhel7:latest" + } + }, + { + "name": "5.20", + "annotations": { + "openshift.io/display-name": "Perl 5.20", + "description": "Build and run Perl 5.20 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-perl-container/blob/master/5.20/README.md.", + "iconClass": "icon-perl", + "tags": "builder,perl", + "supports":"perl:5.20,perl", + "version": "5.20", + "sampleRepo": "https://github.com/openshift/dancer-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/perl-520-rhel7:latest" + } + }, + { + "name": "5.24", + "annotations": { + "openshift.io/display-name": "Perl 5.24", + "description": "Build and run Perl 5.24 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-perl-container/blob/master/5.24/README.md.", + "iconClass": "icon-perl", + "tags": "builder,perl", + "supports":"perl:5.24,perl", + "version": "5.24", + "sampleRepo": "https://github.com/openshift/dancer-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/perl-524-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "php", + "annotations": { + "openshift.io/display-name": "PHP" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "PHP (Latest)", + "description": "Build and run PHP applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/5.6/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of PHP available on OpenShift, including major versions updates.", + "iconClass": "icon-php", + "tags": "builder,php", + "supports":"php", + "sampleRepo": "https://github.com/openshift/cakephp-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "7.0" + } + }, + { + "name": "5.5", + "annotations": { + "openshift.io/display-name": "PHP 5.5", + "description": "Build and run PHP 5.5 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/5.5/README.md.", + "iconClass": "icon-php", + "tags": "hidden,builder,php", + "supports":"php:5.5,php", + "version": "5.5", + "sampleRepo": "https://github.com/openshift/cakephp-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/php-55-rhel7:latest" + } + }, + { + "name": "5.6", + "annotations": { + "openshift.io/display-name": "PHP 5.6", + "description": "Build and run PHP 5.6 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/5.6/README.md.", + "iconClass": "icon-php", + "tags": "builder,php", + "supports":"php:5.6,php", + "version": "5.6", + "sampleRepo": "https://github.com/openshift/cakephp-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/php-56-rhel7:latest" + } + }, + { + "name": "7.0", + "annotations": { + "openshift.io/display-name": "PHP 7.0", + "description": "Build and run PHP 7.0 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/7.0/README.md.", + "iconClass": "icon-php", + "tags": "builder,php", + "supports":"php:7.0,php", + "version": "7.0", + "sampleRepo": "https://github.com/openshift/cakephp-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/php-70-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "python", + "annotations": { + "openshift.io/display-name": "Python" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Python (Latest)", + "description": "Build and run Python applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.5/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Python available on OpenShift, including major versions updates.", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "ImageStreamTag", + "name": "3.5" + } + }, + { + "name": "3.3", + "annotations": { + "openshift.io/display-name": "Python 3.3", + "description": "Build and run Python 3.3 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.3/README.md.", + "iconClass": "icon-python", + "tags": "hidden,builder,python", + "supports":"python:3.3,python", + "version": "3.3", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/python-33-rhel7:latest" + } + }, + { + "name": "2.7", + "annotations": { + "openshift.io/display-name": "Python 2.7", + "description": "Build and run Python 2.7 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/2.7/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python:2.7,python", + "version": "2.7", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/python-27-rhel7:latest" + } + }, + { + "name": "3.4", + "annotations": { + "openshift.io/display-name": "Python 3.4", + "description": "Build and run Python 3.4 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.4/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python:3.4,python", + "version": "3.4", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/python-34-rhel7:latest" + } + }, + { + "name": "3.5", + "annotations": { + "openshift.io/display-name": "Python 3.5", + "description": "Build and run Python 3.5 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.5/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "supports":"python:3.5,python", + "version": "3.5", + "sampleRepo": "https://github.com/openshift/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/python-35-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "mysql", + "annotations": { + "openshift.io/display-name": "MySQL" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "MySQL (Latest)", + "description": "Provides a MySQL database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mysql-container/tree/master/5.6/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of MySQL available on OpenShift, including major versions updates.", + "iconClass": "icon-mysql-database", + "tags": "mysql" + }, + "from": { + "kind": "ImageStreamTag", + "name": "5.7" + } + }, + { + "name": "5.5", + "annotations": { + "openshift.io/display-name": "MySQL 5.5", + "description": "Provides a MySQL 5.5 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mysql-container/tree/master/5.5/README.md.", + "iconClass": "icon-mysql-database", + "tags": "hidden,mysql", + "version": "5.5" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/mysql-55-rhel7:latest" + } + }, + { + "name": "5.6", + "annotations": { + "openshift.io/display-name": "MySQL 5.6", + "description": "Provides a MySQL 5.6 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mysql-container/tree/master/5.6/README.md.", + "iconClass": "icon-mysql-database", + "tags": "mysql", + "version": "5.6" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/mysql-56-rhel7:latest" + } + }, + { + "name": "5.7", + "annotations": { + "openshift.io/display-name": "MySQL 5.7", + "description": "Provides a MySQL 5.7 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mysql-container/tree/master/5.7/README.md.", + "iconClass": "icon-mysql-database", + "tags": "mysql", + "version": "5.7" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/mysql-57-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "mariadb", + "annotations": { + "openshift.io/display-name": "MariaDB" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "MariaDB (Latest)", + "description": "Provides a MariaDB database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.1/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of MariaDB available on OpenShift, including major versions updates.", + "iconClass": "icon-mariadb", + "tags": "mariadb" + }, + "from": { + "kind": "ImageStreamTag", + "name": "10.1" + } + }, + { + "name": "10.1", + "annotations": { + "openshift.io/display-name": "MariaDB 10.1", + "description": "Provides a MariaDB 10.1 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.1/README.md.", + "iconClass": "icon-mariadb", + "tags": "mariadb", + "version": "10.1" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/mariadb-101-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "postgresql", + "annotations": { + "openshift.io/display-name": "PostgreSQL" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "PostgreSQL (Latest)", + "description": "Provides a PostgreSQL database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/tree/master/9.5.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of PostgreSQL available on OpenShift, including major versions updates.", + "iconClass": "icon-postgresql", + "tags": "postgresql" + }, + "from": { + "kind": "ImageStreamTag", + "name": "9.5" + } + }, + { + "name": "9.2", + "annotations": { + "openshift.io/display-name": "PostgreSQL 9.2", + "description": "Provides a PostgreSQL 9.2 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/tree/master/9.2.", + "iconClass": "icon-postgresql", + "tags": "hidden,postgresql", + "version": "9.2" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/postgresql-92-rhel7:latest" + } + }, + { + "name": "9.4", + "annotations": { + "openshift.io/display-name": "PostgreSQL 9.4", + "description": "Provides a PostgreSQL 9.4 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/tree/master/9.4.", + "iconClass": "icon-postgresql", + "tags": "postgresql", + "version": "9.4" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/postgresql-94-rhel7:latest" + } + }, + { + "name": "9.5", + "annotations": { + "openshift.io/display-name": "PostgreSQL 9.5", + "description": "Provides a PostgreSQL 9.5 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/tree/master/9.5.", + "iconClass": "icon-postgresql", + "tags": "postgresql", + "version": "9.5" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/postgresql-95-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "mongodb", + "annotations": { + "openshift.io/display-name": "MongoDB" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "MongoDB (Latest)", + "description": "Provides a MongoDB database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/tree/master/3.2/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of MongoDB available on OpenShift, including major versions updates.", + "iconClass": "icon-mongodb", + "tags": "mongodb" + }, + "from": { + "kind": "ImageStreamTag", + "name": "3.2" + } + }, + { + "name": "2.4", + "annotations": { + "openshift.io/display-name": "MongoDB 2.4", + "description": "Provides a MongoDB 2.4 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/tree/master/2.4/README.md.", + "iconClass": "icon-mongodb", + "tags": "hidden,mongodb", + "version": "2.4" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/mongodb-24-rhel7:latest" + } + }, + { + "name": "2.6", + "annotations": { + "openshift.io/display-name": "MongoDB 2.6", + "description": "Provides a MongoDB 2.6 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/tree/master/2.6/README.md.", + "iconClass": "icon-mongodb", + "tags": "mongodb", + "version": "2.6" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/mongodb-26-rhel7:latest" + } + }, + { + "name": "3.2", + "annotations": { + "openshift.io/display-name": "MongoDB 3.2", + "description": "Provides a MongoDB 3.2 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/tree/master/3.2/README.md.", + "iconClass": "icon-mongodb", + "tags": "mongodb", + "version": "3.2" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/mongodb-32-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "redis", + "annotations": { + "openshift.io/display-name": "Redis" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Redis (Latest)", + "description": "Provides a Redis database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/redis-container/tree/master/3.2/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Redis available on OpenShift, including major versions updates.", + "iconClass": "icon-redis", + "tags": "redis" + }, + "from": { + "kind": "ImageStreamTag", + "name": "3.2" + } + }, + { + "name": "3.2", + "annotations": { + "openshift.io/display-name": "Redis 3.2", + "description": "Provides a Redis 3.2 database on RHEL 7. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/redis-container/tree/master/3.2/README.md.", + "iconClass": "icon-redis", + "tags": "redis", + "version": "3.2" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/rhscl/redis-32-rhel7:latest" + } + } + ] + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "jenkins", + "annotations": { + "openshift.io/display-name": "Jenkins" + } + }, + "spec": { + "tags": [ + { + "name": "latest", + "annotations": { + "openshift.io/display-name": "Jenkins (Latest)", + "description": "Provides a Jenkins server on RHEL 7. For more information about using this container image, including OpenShift considerations, see https://github.com/openshift/jenkins/blob/master/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of Jenkins available on OpenShift, including major versions updates.", + "iconClass": "icon-jenkins", + "tags": "jenkins" + }, + "from": { + "kind": "ImageStreamTag", + "name": "2" + } + }, + { + "name": "1", + "annotations": { + "openshift.io/display-name": "Jenkins 1.X", + "description": "Provides a Jenkins 1.X server on RHEL 7. For more information about using this container image, including OpenShift considerations, see https://github.com/openshift/jenkins/blob/master/README.md.", + "iconClass": "icon-jenkins", + "tags": "jenkins", + "version": "1.x" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/jenkins-1-rhel7:latest" + } + }, + { + "name": "2", + "annotations": { + "openshift.io/display-name": "Jenkins 2.X", + "description": "Provides a Jenkins 2.X server on RHEL 7. For more information about using this container image, including OpenShift considerations, see https://github.com/openshift/jenkins/blob/master/README.md.", + "iconClass": "icon-jenkins", + "tags": "jenkins", + "version": "2.x" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/openshift3/jenkins-2-rhel7:latest" + } + } + ] + } + } + ] +} +`) + +func examplesImageStreamsImageStreamsRhel7JsonBytes() ([]byte, error) { + return _examplesImageStreamsImageStreamsRhel7Json, nil +} + +func examplesImageStreamsImageStreamsRhel7Json() (*asset, error) { + bytes, err := examplesImageStreamsImageStreamsRhel7JsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/image-streams/image-streams-rhel7.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesSampleAppApplicationTemplateCustombuildJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "ruby-helloworld-sample", + "creationTimestamp": null, + "annotations": { + "description": "This example shows how to create a simple ruby application in openshift origin v3", + "iconClass": "icon-ruby", + "tags": "instant-app,ruby,mysql" + } + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "dbsecret" + }, + "stringData" : { + "mysql-user" : "${MYSQL_USER}", + "mysql-password" : "${MYSQL_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 5432, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "route-edge", + "creationTimestamp": null + }, + "spec": { + "host": "www.example.com", + "to": { + "kind": "Service", + "name": "frontend" + }, + "tls": { + "termination": "edge" + } + }, + "status": {} + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-ruby-sample", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-custom-docker-builder", + "creationTimestamp": null + }, + "spec": { + "dockerImageRepository": "openshift/origin-custom-docker-builder" + }, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build", + "creationTimestamp": null, + "labels": { + "name": "ruby-sample-build" + } + }, + "spec": { + "triggers": [ + { + "type": "GitHub", + "github": { + "secret": "secret101" + } + }, + { + "type": "Generic", + "generic": { + "secret": "secret101", + "allowEnv": true + } + }, + { + "type": "ImageChange", + "imageChange": {} + }, + { + "type": "ConfigChange" + } + ], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Custom", + "customStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "origin-custom-docker-builder:latest" + }, + "env": [ + { + "name": "OPENSHIFT_CUSTOM_BUILD_BASE_IMAGE", + "value": "openshift/origin-custom-docker-builder" + } + ], + "exposeDockerSocket": true + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + }, + "postCommit": { + "args": ["bundle", "exec", "rake", "test"] + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 120, + "pre": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR1", + "value": "custom_value1" + } + ], + "containerName": "ruby-helloworld" + } + }, + "post": { + "failurePolicy": "Ignore", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld" + } + } + }, + "resources": {} + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "ruby-helloworld" + ], + "from": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 2, + "selector": { + "name": "frontend" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "frontend" + } + }, + "spec": { + "containers": [ + { + "name": "ruby-helloworld", + "image": "origin-ruby-sample", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "database", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "db", + "protocol": "TCP", + "port": 5434, + "targetPort": 3306, + "nodePort": 0 + } + ], + "selector": { + "name": "database" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "database", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate", + "recreateParams": { + "pre": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR1", + "value": "custom_value1" + } + ], + "containerName": "ruby-helloworld-database", + "volumes": ["ruby-helloworld-data"] + } + }, + "mid": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld-database", + "volumes": ["ruby-helloworld-data"] + } + }, + "post": { + "failurePolicy": "Ignore", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld-database", + "volumes": ["ruby-helloworld-data"] + } + } + }, + "resources": {} + }, + "triggers": [ + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "database" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "database" + } + }, + "spec": { + "containers": [ + { + "name": "ruby-helloworld-database", + "image": "centos/mysql-57-centos7:latest", + "ports": [ + { + "containerPort": 3306, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": {}, + "volumeMounts": [ + { + "name": "ruby-helloworld-data", + "mountPath": "/var/lib/mysql/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "Always", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "ruby-helloworld-data", + "emptyDir": { + "medium": "" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MYSQL_USER", + "description": "database username", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MYSQL_PASSWORD", + "description": "database password", + "generate": "expression", + "from": "[a-zA-Z0-9]{8}", + "required": true + }, + { + "name": "MYSQL_DATABASE", + "description": "database name", + "value": "root", + "required": true + } + ], + "labels": { + "template": "application-template-custombuild" + } +} +`) + +func examplesSampleAppApplicationTemplateCustombuildJsonBytes() ([]byte, error) { + return _examplesSampleAppApplicationTemplateCustombuildJson, nil +} + +func examplesSampleAppApplicationTemplateCustombuildJson() (*asset, error) { + bytes, err := examplesSampleAppApplicationTemplateCustombuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/sample-app/application-template-custombuild.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesSampleAppApplicationTemplateDockerbuildJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "ruby-helloworld-sample", + "creationTimestamp": null, + "annotations": { + "description": "This example shows how to create a simple ruby application in openshift origin v3", + "iconClass": "icon-ruby", + "tags": "instant-app,ruby,mysql" + } + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "dbsecret" + }, + "stringData" : { + "mysql-user" : "${MYSQL_USER}", + "mysql-password" : "${MYSQL_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 5432, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "route-edge", + "creationTimestamp": null + }, + "spec": { + "host": "www.example.com", + "to": { + "kind": "Service", + "name": "frontend" + }, + "tls": { + "termination": "edge" + } + }, + "status": {} + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-ruby-sample", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "ruby-22-centos7", + "creationTimestamp": null + }, + "spec": { + "dockerImageRepository": "centos/ruby-22-centos7" + }, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build", + "creationTimestamp": null, + "labels": { + "name": "ruby-sample-build" + } + }, + "spec": { + "triggers": [ + { + "type": "GitHub", + "github": { + "secret": "secret101" + } + }, + { + "type": "Generic", + "generic": { + "secret": "secret101", + "allowEnv": true + } + }, + { + "type": "ImageChange", + "imageChange": {} + }, + { + "type": "ConfigChange" + } + ], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Docker", + "dockerStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "ruby-22-centos7:latest" + }, + "env": [ + { + "name": "EXAMPLE", + "value": "sample-app" + } + ] + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + }, + "postCommit": { + "args": ["bundle", "exec", "rake", "test"] + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 120, + "pre": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR1", + "value": "custom_value1" + } + ], + "containerName": "ruby-helloworld" + } + }, + "post": { + "failurePolicy": "Ignore", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld" + } + } + }, + "resources": {} + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "ruby-helloworld" + ], + "from": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 2, + "selector": { + "name": "frontend" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "frontend" + } + }, + "spec": { + "containers": [ + { + "name": "ruby-helloworld", + "image": "origin-ruby-sample", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "database", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "db", + "protocol": "TCP", + "port": 5434, + "targetPort": 3306, + "nodePort": 0 + } + ], + "selector": { + "name": "database" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "database", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate", + "resources": {} + }, + "triggers": [ + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "database" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "database" + } + }, + "spec": { + "containers": [ + { + "name": "ruby-helloworld-database", + "image": "centos/mysql-57-centos7:latest", + "ports": [ + { + "containerPort": 3306, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": {}, + "volumeMounts": [ + { + "name": "ruby-helloworld-data", + "mountPath": "/var/lib/mysql/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "Always", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "ruby-helloworld-data", + "emptyDir": { + "medium": "" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MYSQL_USER", + "description": "database username", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MYSQL_PASSWORD", + "description": "database password", + "generate": "expression", + "from": "[a-zA-Z0-9]{8}", + "required": true + }, + { + "name": "MYSQL_DATABASE", + "description": "database name", + "value": "root", + "required": true + } + ], + "labels": { + "template": "application-template-dockerbuild" + } +} +`) + +func examplesSampleAppApplicationTemplateDockerbuildJsonBytes() ([]byte, error) { + return _examplesSampleAppApplicationTemplateDockerbuildJson, nil +} + +func examplesSampleAppApplicationTemplateDockerbuildJson() (*asset, error) { + bytes, err := examplesSampleAppApplicationTemplateDockerbuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/sample-app/application-template-dockerbuild.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesSampleAppApplicationTemplatePullspecbuildJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "ruby-helloworld-sample", + "creationTimestamp": null, + "annotations": { + "description": "This example shows how to create a simple ruby application in openshift origin v3", + "iconClass": "icon-ruby", + "tags": "instant-app,ruby,mysql" + } + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "dbsecret" + }, + "stringData" : { + "mysql-user" : "${MYSQL_USER}", + "mysql-password" : "${MYSQL_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 5432, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "route-edge", + "creationTimestamp": null + }, + "spec": { + "host": "www.example.com", + "to": { + "kind": "Service", + "name": "frontend" + }, + "tls": { + "termination": "edge" + } + }, + "status": {} + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-ruby-sample", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "ruby-22-centos7", + "creationTimestamp": null + }, + "spec": { + "dockerImageRepository": "centos/ruby-22-centos7" + }, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build", + "creationTimestamp": null, + "labels": { + "name": "ruby-sample-build" + } + }, + "spec": { + "triggers": [ + { + "type": "GitHub", + "github": { + "secret": "secret101" + } + }, + { + "type": "Generic", + "generic": { + "secret": "secret101", + "allowEnv": true + } + }, + { + "type": "ConfigChange" + } + ], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "DockerImage", + "name": "centos/ruby-22-centos7:latest" + } + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + }, + "postCommit": { + "args": ["bundle", "exec", "rake", "test"] + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 120, + "pre": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR1", + "value": "custom_value1" + } + ], + "containerName": "ruby-helloworld" + } + }, + "post": { + "failurePolicy": "Ignore", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld" + } + } + }, + "resources": {} + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "ruby-helloworld" + ], + "from": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 2, + "selector": { + "name": "frontend" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "frontend" + } + }, + "spec": { + "containers": [ + { + "name": "ruby-helloworld", + "image": "origin-ruby-sample", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "database", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "db", + "protocol": "TCP", + "port": 5434, + "targetPort": 3306, + "nodePort": 0 + } + ], + "selector": { + "name": "database" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "database", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate", + "recreateParams": { + "pre": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR1", + "value": "custom_value1" + } + ], + "containerName": "ruby-helloworld-database", + "volumes": ["ruby-helloworld-data"] + } + }, + "mid": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld-database", + "volumes": ["ruby-helloworld-data"] + } + }, + "post": { + "failurePolicy": "Ignore", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld-database", + "volumes": ["ruby-helloworld-data"] + } + } + }, + "resources": {} + }, + "triggers": [ + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "database" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "database" + } + }, + "spec": { + "containers": [ + { + "name": "ruby-helloworld-database", + "image": "centos/mysql-57-centos7:latest", + "ports": [ + { + "containerPort": 3306, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": {}, + "volumeMounts": [ + { + "name": "ruby-helloworld-data", + "mountPath": "/var/lib/mysql/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "Always", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "ruby-helloworld-data", + "emptyDir": { + "medium": "" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MYSQL_USER", + "description": "database username", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MYSQL_PASSWORD", + "description": "database password", + "generate": "expression", + "from": "[a-zA-Z0-9]{8}", + "required": true + }, + { + "name": "MYSQL_DATABASE", + "description": "database name", + "value": "root", + "required": true + } + ], + "labels": { + "template": "application-template-stibuild" + } +} +`) + +func examplesSampleAppApplicationTemplatePullspecbuildJsonBytes() ([]byte, error) { + return _examplesSampleAppApplicationTemplatePullspecbuildJson, nil +} + +func examplesSampleAppApplicationTemplatePullspecbuildJson() (*asset, error) { + bytes, err := examplesSampleAppApplicationTemplatePullspecbuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/sample-app/application-template-pullspecbuild.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesSampleAppApplicationTemplateStibuildJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "ruby-helloworld-sample", + "creationTimestamp": null, + "annotations": { + "description": "This example shows how to create a simple ruby application in openshift origin v3", + "iconClass": "icon-ruby", + "tags": "instant-app,ruby,mysql" + } + }, + "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "dbsecret" + }, + "stringData" : { + "mysql-user" : "${MYSQL_USER}", + "mysql-password" : "${MYSQL_PASSWORD}" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 5432, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "route-edge", + "creationTimestamp": null + }, + "spec": { + "host": "www.example.com", + "to": { + "kind": "Service", + "name": "frontend" + }, + "tls": { + "termination": "edge" + } + }, + "status": {} + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-ruby-sample", + "creationTimestamp": null + }, + "spec": {}, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "ruby-22-centos7", + "creationTimestamp": null + }, + "spec": { + "dockerImageRepository": "centos/ruby-22-centos7" + }, + "status": { + "dockerImageRepository": "" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "ruby-sample-build", + "creationTimestamp": null, + "labels": { + "name": "ruby-sample-build" + } + }, + "spec": { + "triggers": [ + { + "type": "GitHub", + "github": { + "secret": "secret101" + } + }, + { + "type": "Generic", + "generic": { + "secret": "secret101", + "allowEnv": true + } + }, + { + "type": "ImageChange", + "imageChange": {} + }, + { + "type": "ConfigChange" + } + ], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/ruby-hello-world.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "ruby-22-centos7:latest" + }, + "env": [ + { + "name": "EXAMPLE", + "value": "sample-app" + } + ] + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + }, + "postCommit": { + "args": ["bundle", "exec", "rake", "test"] + }, + "resources": {} + }, + "status": { + "lastVersion": 0 + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 120, + "pre": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR1", + "value": "custom_value1" + } + ], + "containerName": "ruby-helloworld" + } + }, + "post": { + "failurePolicy": "Ignore", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld" + } + } + }, + "resources": {} + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "ruby-helloworld" + ], + "from": { + "kind": "ImageStreamTag", + "name": "origin-ruby-sample:latest" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 2, + "selector": { + "name": "frontend" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "frontend" + } + }, + "spec": { + "containers": [ + { + "name": "ruby-helloworld", + "image": "origin-ruby-sample", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "database", + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "db", + "protocol": "TCP", + "port": 5434, + "targetPort": 3306, + "nodePort": 0 + } + ], + "selector": { + "name": "database" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "database", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate", + "recreateParams": { + "pre": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR1", + "value": "custom_value1" + } + ], + "containerName": "ruby-helloworld-database", + "volumes": ["ruby-helloworld-data"] + } + }, + "mid": { + "failurePolicy": "Abort", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld-database", + "volumes": ["ruby-helloworld-data"] + } + }, + "post": { + "failurePolicy": "Ignore", + "execNewPod": { + "command": [ + "/bin/true" + ], + "env": [ + { + "name": "CUSTOM_VAR2", + "value": "custom_value2" + } + ], + "containerName": "ruby-helloworld-database", + "volumes": ["ruby-helloworld-data"] + } + } + }, + "resources": {} + }, + "triggers": [ + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "database" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "database" + } + }, + "spec": { + "containers": [ + { + "name": "ruby-helloworld-database", + "image": "centos/mysql-57-centos7:latest", + "ports": [ + { + "containerPort": 3306, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "MYSQL_USER", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-user" + } + } + }, + { + "name": "MYSQL_PASSWORD", + "valueFrom": { + "secretKeyRef" : { + "name" : "dbsecret", + "key" : "mysql-password" + } + } + }, + { + "name": "MYSQL_DATABASE", + "value": "${MYSQL_DATABASE}" + } + ], + "resources": {}, + "volumeMounts": [ + { + "name": "ruby-helloworld-data", + "mountPath": "/var/lib/mysql/data" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "Always", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "ruby-helloworld-data", + "emptyDir": { + "medium": "" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + }, + "status": {} + } + ], + "parameters": [ + { + "name": "MYSQL_USER", + "description": "database username", + "generate": "expression", + "from": "user[A-Z0-9]{3}", + "required": true + }, + { + "name": "MYSQL_PASSWORD", + "description": "database password", + "generate": "expression", + "from": "[a-zA-Z0-9]{8}", + "required": true + }, + { + "name": "MYSQL_DATABASE", + "description": "database name", + "value": "root", + "required": true + } + ], + "labels": { + "template": "application-template-stibuild" + } +} +`) + +func examplesSampleAppApplicationTemplateStibuildJsonBytes() ([]byte, error) { + return _examplesSampleAppApplicationTemplateStibuildJson, nil +} + +func examplesSampleAppApplicationTemplateStibuildJson() (*asset, error) { + bytes, err := examplesSampleAppApplicationTemplateStibuildJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/sample-app/application-template-stibuild.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesSampleAppCleanupSh = []byte(`#!/bin/sh + +echo "Killing openshift all-in-one server ..." +sudo pkill -x openshift + +echo "Stopping all k8s docker containers on host ..." +sudo docker ps --format='{{.Names}}' | grep -E '^k8s_' | xargs -l -r sudo docker stop + +echo "Unmounting openshift local volumes ..." +mount | grep "openshift.local.volumes" | awk '{ print $3}' | xargs -l -r sudo umount + +echo "Cleaning up openshift runtime files ..." +sudo rm -rf openshift.local.* + + +`) + +func examplesSampleAppCleanupShBytes() ([]byte, error) { + return _examplesSampleAppCleanupSh, nil +} + +func examplesSampleAppCleanupSh() (*asset, error) { + bytes, err := examplesSampleAppCleanupShBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/sample-app/cleanup.sh", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesSampleAppGithubWebhookExampleJson = []byte(`{ + "after": "9bdc3a26ff933b32f3e558636b58aea86a69f051", + "before": "0000000000000000000000000000000000000000", + "commits": [ + { + "added": [ + "LICENSE" + ], + "author": { + "email": "anonUser@example.com", + "name": "Anonymous User" + }, + "committer": { + "email": "anonUser@example.com", + "name": "Anonymous User" + }, + "distinct": true, + "id": "9bdc3a26ff933b32f3e558636b58aea86a69f051", + "message": "Added license", + "modified": [], + "removed": [], + "timestamp": "2014-08-28T16:55:36+02:00", + "url": "https://github.com/anonUser/anonRepo/commit/9bdc3a26ff933b32f3e558636b58aea86a69f051" + } + ], + "compare": "https://github.com/anonUser/anonRepo/commit/9bdc3a26ff93", + "created": true, + "deleted": false, + "forced": true, + "head_commit": { + "added": [ + "LICENSE" + ], + "author": { + "email": "anonUser@example.com", + "name": "Anonymous User" + }, + "committer": { + "email": "anonUser@example.com", + "name": "Anonymous User" + }, + "distinct": true, + "id": "", + "message": "Added license", + "modified": [], + "removed": [], + "timestamp": "2014-08-28T16:55:36+02:00", + "url": "https://github.com/anonUser/anonRepo/commit/9bdc3a26ff933b32f3e558636b58aea86a69f051" + }, + "pusher": { + "email": "anonUser@example.com", + "name": "anonUser" + }, + "ref": "refs/heads/master", + "repository": { + "archive_url": "https://api.github.com/repos/anonUser/anonRepo/{archive_format}{/ref}", + "assignees_url": "https://api.github.com/repos/anonUser/anonRepo/assignees{/user}", + "blobs_url": "https://api.github.com/repos/anonUser/anonRepo/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/anonUser/anonRepo/branches{/branch}", + "clone_url": "https://github.com/anonUser/anonRepo.git", + "collaborators_url": "https://api.github.com/repos/anonUser/anonRepo/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/anonUser/anonRepo/comments{/number}", + "commits_url": "https://api.github.com/repos/anonUser/anonRepo/commits{/sha}", + "compare_url": "https://api.github.com/repos/anonUser/anonRepo/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/anonUser/anonRepo/contents/{+path}", + "contributors_url": "https://api.github.com/repos/anonUser/anonRepo/contributors", + "created_at": 1.409063699e+09, + "default_branch": "master", + "description": "Git webhook implementation in Go.", + "downloads_url": "https://api.github.com/repos/anonUser/anonRepo/downloads", + "events_url": "https://api.github.com/repos/anonUser/anonRepo/events", + "fork": false, + "forks": 0, + "forks_count": 0, + "forks_url": "https://api.github.com/repos/anonUser/anonRepo/forks", + "full_name": "anonUser/anonRepo", + "git_commits_url": "https://api.github.com/repos/anonUser/anonRepo/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/anonUser/anonRepo/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/anonUser/anonRepo/git/tags{/sha}", + "git_url": "git://github.com/anonUser/anonRepo.git", + "has_downloads": true, + "has_issues": true, + "has_wiki": true, + "homepage": null, + "hooks_url": "https://api.github.com/repos/anonUser/anonRepo/hooks", + "html_url": "https://github.com/anonUser/anonRepo", + "id": 2.3354788e+07, + "issue_comment_url": "https://api.github.com/repos/anonUser/anonRepo/issues/comments/{number}", + "issue_events_url": "https://api.github.com/repos/anonUser/anonRepo/issues/events{/number}", + "issues_url": "https://api.github.com/repos/anonUser/anonRepo/issues{/number}", + "keys_url": "https://api.github.com/repos/anonUser/anonRepo/keys{/key_id}", + "labels_url": "https://api.github.com/repos/anonUser/anonRepo/labels{/name}", + "language": null, + "languages_url": "https://api.github.com/repos/anonUser/anonRepo/languages", + "master_branch": "master", + "merges_url": "https://api.github.com/repos/anonUser/anonRepo/merges", + "milestones_url": "https://api.github.com/repos/anonUser/anonRepo/milestones{/number}", + "mirror_url": null, + "name": "anonRepo", + "notifications_url": "https://api.github.com/repos/anonUser/anonRepo/notifications{?since,all,participating}", + "open_issues": 0, + "open_issues_count": 0, + "owner": { + "email": "anonUser@example.com", + "name": "anonUser" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/anonUser/anonRepo/pulls{/number}", + "pushed_at": 1.409238007e+09, + "releases_url": "https://api.github.com/repos/anonUser/anonRepo/releases{/id}", + "size": 0, + "ssh_url": "git@github.com:anonUser/anonRepo.git", + "stargazers": 0, + "stargazers_count": 0, + "stargazers_url": "https://api.github.com/repos/anonUser/anonRepo/stargazers", + "statuses_url": "https://api.github.com/repos/anonUser/anonRepo/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/anonUser/anonRepo/subscribers", + "subscription_url": "https://api.github.com/repos/anonUser/anonRepo/subscription", + "svn_url": "https://github.com/anonUser/anonRepo", + "tags_url": "https://api.github.com/repos/anonUser/anonRepo/tags", + "teams_url": "https://api.github.com/repos/anonUser/anonRepo/teams", + "trees_url": "https://api.github.com/repos/anonUser/anonRepo/git/trees{/sha}", + "updated_at": "2014-08-26T14:34:59Z", + "url": "https://github.com/anonUser/anonRepo", + "watchers": 0, + "watchers_count": 0 + } +} +`) + +func examplesSampleAppGithubWebhookExampleJsonBytes() ([]byte, error) { + return _examplesSampleAppGithubWebhookExampleJson, nil +} + +func examplesSampleAppGithubWebhookExampleJson() (*asset, error) { + bytes, err := examplesSampleAppGithubWebhookExampleJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/sample-app/github-webhook-example.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesSampleAppPullimagesSh = []byte(`#!/bin/sh +docker pull openshift/origin-docker-registry +#docker pull openshift/origin-docker-builder +docker pull openshift/origin-sti-builder +docker pull openshift/origin-deployer +docker pull openshift/origin-pod +`) + +func examplesSampleAppPullimagesShBytes() ([]byte, error) { + return _examplesSampleAppPullimagesSh, nil +} + +func examplesSampleAppPullimagesSh() (*asset, error) { + bytes, err := examplesSampleAppPullimagesShBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/sample-app/pullimages.sh", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesHelloOpenshiftDockerfile = []byte(`FROM scratch +MAINTAINER Jessica Forrester +COPY bin/hello-openshift /hello-openshift +EXPOSE 8080 8888 +ENTRYPOINT ["/hello-openshift"] +`) + +func examplesHelloOpenshiftDockerfileBytes() ([]byte, error) { + return _examplesHelloOpenshiftDockerfile, nil +} + +func examplesHelloOpenshiftDockerfile() (*asset, error) { + bytes, err := examplesHelloOpenshiftDockerfileBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/hello-openshift/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesHelloOpenshiftHelloPodJson = []byte(`{ + "kind": "Pod", + "apiVersion": "v1", + "metadata": { + "name": "hello-openshift", + "creationTimestamp": null, + "labels": { + "name": "hello-openshift" + } + }, + "spec": { + "containers": [ + { + "name": "hello-openshift", + "image": "openshift/hello-openshift", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "resources": {}, + "volumeMounts": [ + { + "name":"tmp", + "mountPath":"/tmp" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name":"tmp", + "emptyDir": {} + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst", + "serviceAccount": "" + }, + "status": {} +} +`) + +func examplesHelloOpenshiftHelloPodJsonBytes() ([]byte, error) { + return _examplesHelloOpenshiftHelloPodJson, nil +} + +func examplesHelloOpenshiftHelloPodJson() (*asset, error) { + bytes, err := examplesHelloOpenshiftHelloPodJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/hello-openshift/hello-pod.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesHelloOpenshiftHelloProjectJson = []byte(`{ + "kind": "Project", + "apiVersion": "v1", + "metadata": { + "name": "hello-openshift-project", + "creationTimestamp": null, + "labels": { + "name": "hello-openshift-project" + }, + "annotations": { + "openshift.io/description": "This is an example project to demonstrate OpenShift v3", + "openshift.io/display-name": "Hello OpenShift" + } + }, + "spec": {}, + "status": {} +} +`) + +func examplesHelloOpenshiftHelloProjectJsonBytes() ([]byte, error) { + return _examplesHelloOpenshiftHelloProjectJson, nil +} + +func examplesHelloOpenshiftHelloProjectJson() (*asset, error) { + bytes, err := examplesHelloOpenshiftHelloProjectJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/hello-openshift/hello-project.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesJenkinsApplicationTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "nodejs-helloworld-sample", + "annotations": { + "description": "This example shows how to create a simple nodejs application in openshift origin v3", + "iconClass": "icon-nodejs", + "tags": "instant-app,nodejs" + } + }, + "objects": [ + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend-prod" + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 8080, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend-prod" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + }, + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "frontend" + }, + "spec": { + "to": { + "kind": "Service", + "name": "frontend" + }, + "tls": { + "termination": "edge" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend-prod" + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 120 + } + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "nodejs-helloworld" + ], + "from": { + "kind": "ImageStreamTag", + "name": "origin-nodejs-sample:prod" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name":"frontend-prod" + }, + "template": { + "metadata": { + "labels": { + "name": "frontend-prod" + } + }, + "spec": { + "containers": [ + { + "name": "nodejs-helloworld", + "image": " ", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "frontend" + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 8080, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "frontend" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-nodejs-sample" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-nodejs-sample2" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "origin-nodejs-sample3" + } + }, + { + "kind": "ImageStream", + "apiVersion": "v1", + "metadata": { + "name": "nodejs-010-centos7" + }, + "spec": { + "dockerImageRepository": "${NAMESPACE}/nodejs-010-centos7" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend", + "labels": { + "name": "nodejs-sample-build" + } + }, + "spec": { + "triggers": [ + { + "type": "GitHub", + "github": { + "secret": "secret101" + } + }, + { + "type": "Generic", + "generic": { + "secret": "secret101" + } + } + ], + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/openshift/nodejs-ex.git" + } + }, + "strategy": { + "type": "Source", + "sourceStrategy": { + "from": { + "kind": "ImageStreamTag", + "name": "nodejs-010-centos7:latest" + } + } + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "origin-nodejs-sample:latest" + } + }, + "resources": {} + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "frontend" + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 120 + } + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": false, + "containerNames": [ + "nodejs-helloworld" + ], + "from": { + "kind": "ImageStreamTag", + "name": "origin-nodejs-sample:latest" + } + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name":"frontend" + }, + "template": { + "metadata": { + "labels": { + "name": "frontend" + } + }, + "spec": { + "containers": [ + { + "name": "nodejs-helloworld", + "image": " ", + "ports": [ + { + "containerPort": 8080, + "protocol": "TCP" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + } + } + ], + "parameters": [ + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi" + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { + "name": "ADMIN_USERNAME", + "displayName": "Administrator Username", + "description": "Username for the administrator of this application.", + "generate": "expression", + "from": "admin[A-Z0-9]{3}" + }, + { + "name": "ADMIN_PASSWORD", + "displayName": "Administrator Password", + "description": "Password for the administrator of this application.", + "generate": "expression", + "from": "[a-zA-Z0-9]{8}" + } + ], + "labels": { + "template": "application-template-stibuild" + } +} +`) + +func examplesJenkinsApplicationTemplateJsonBytes() ([]byte, error) { + return _examplesJenkinsApplicationTemplateJson, nil +} + +func examplesJenkinsApplicationTemplateJson() (*asset, error) { + bytes, err := examplesJenkinsApplicationTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/jenkins/application-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesJenkinsJenkinsEphemeralTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "jenkins-ephemeral", + "creationTimestamp": null, + "annotations": { + "openshift.io/display-name": "Jenkins (Ephemeral)", + "description": "Jenkins service, without persistent storage.\n\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing.", + "iconClass": "icon-jenkins", + "tags": "instant-app,jenkins", + "template.openshift.io/long-description": "This template deploys a Jenkins server capable of managing OpenShift Pipeline builds and supporting OpenShift-based oauth login. The Jenkins configuration is stored in non-persistent storage, so this configuration should be used for experimental purposes only.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://docs.openshift.org/latest/using_images/other_images/jenkins.html", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "A Jenkins service has been created in your project. Log into Jenkins with your OpenShift account. The tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.", + "objects": [ + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "to": { + "kind": "Service", + "name": "${JENKINS_SERVICE_NAME}" + }, + "tls": { + "termination": "edge", + "insecureEdgeTerminationPolicy": "Redirect" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "jenkins" + ], + "from": { + "kind": "ImageStreamTag", + "name": "${JENKINS_IMAGE_STREAM_TAG}", + "namespace": "${NAMESPACE}" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${JENKINS_SERVICE_NAME}" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "${JENKINS_SERVICE_NAME}" + } + }, + "spec": { + "serviceAccountName": "${JENKINS_SERVICE_NAME}", + "containers": [ + { + "name": "jenkins", + "image": " ", + "readinessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 3, + "httpGet": { + "path": "/login", + "port": 8080 + } + }, + "livenessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 420, + "failureThreshold" : 30, + "httpGet": { + "path": "/login", + "port": 8080 + } + }, + "env": [ + { + "name": "OPENSHIFT_ENABLE_OAUTH", + "value": "${ENABLE_OAUTH}" + }, + { + "name": "OPENSHIFT_ENABLE_REDIRECT_PROMPT", + "value": "true" + }, + { + "name": "OPENSHIFT_JENKINS_JVM_ARCH", + "value": "${JVM_ARCH}" + }, + { + "name": "KUBERNETES_MASTER", + "value": "https://kubernetes.default:443" + }, + { + "name": "KUBERNETES_TRUST_CERTIFICATES", + "value": "true" + }, + { + "name": "JNLP_SERVICE_NAME", + "value": "${JNLP_SERVICE_NAME}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${JENKINS_SERVICE_NAME}-data", + "mountPath": "/var/lib/jenkins" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "${JENKINS_SERVICE_NAME}-data", + "emptyDir": { + "medium": "" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + } + }, + { + "kind": "ServiceAccount", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}", + "annotations": { + "serviceaccounts.openshift.io/oauth-redirectreference.jenkins": "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"${JENKINS_SERVICE_NAME}\"}}" + } + } + }, + { + "kind": "RoleBinding", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}_edit" + }, + "groupNames": null, + "subjects": [ + { + "kind": "ServiceAccount", + "name": "${JENKINS_SERVICE_NAME}" + } + ], + "roleRef": { + "name": "edit" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${JNLP_SERVICE_NAME}" + }, + "spec": { + "ports": [ + { + "name": "agent", + "protocol": "TCP", + "port": 50000, + "targetPort": 50000, + "nodePort": 0 + } + ], + "selector": { + "name": "${JENKINS_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}", + "annotations": { + "service.alpha.openshift.io/dependencies": "[{\"name\": \"${JNLP_SERVICE_NAME}\", \"namespace\": \"\", \"kind\": \"Service\"}]", + "service.openshift.io/infrastructure": "true" + }, + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 80, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "${JENKINS_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + } + } + ], + "parameters": [ + { + "name": "JENKINS_SERVICE_NAME", + "displayName": "Jenkins Service Name", + "description": "The name of the OpenShift Service exposed for the Jenkins container.", + "value": "jenkins" + }, + { + "name": "JNLP_SERVICE_NAME", + "displayName": "Jenkins JNLP Service Name", + "description": "The name of the service used for master/slave communication.", + "value": "jenkins-jnlp" + }, + { + "name": "ENABLE_OAUTH", + "displayName": "Enable OAuth in Jenkins", + "description": "Whether to enable OAuth OpenShift integration. If false, the static account 'admin' will be initialized with the password 'password'.", + "value": "true" + }, + { + "name": "JVM_ARCH", + "displayName": "Jenkins JVM Architecture", + "description": "Whether Jenkins runs with a 32 bit (i386) or 64 bit (x86_64) JVM.", + "value": "i386" + }, + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi" + }, + { + "name": "NAMESPACE", + "displayName": "Jenkins ImageStream Namespace", + "description": "The OpenShift Namespace where the Jenkins ImageStream resides.", + "value": "openshift" + }, + { + "name": "JENKINS_IMAGE_STREAM_TAG", + "displayName": "Jenkins ImageStreamTag", + "description": "Name of the ImageStreamTag to be used for the Jenkins image.", + "value": "jenkins:latest" + } + ], + "labels": { + "template": "jenkins-ephemeral-template" + } +} +`) + +func examplesJenkinsJenkinsEphemeralTemplateJsonBytes() ([]byte, error) { + return _examplesJenkinsJenkinsEphemeralTemplateJson, nil +} + +func examplesJenkinsJenkinsEphemeralTemplateJson() (*asset, error) { + bytes, err := examplesJenkinsJenkinsEphemeralTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/jenkins/jenkins-ephemeral-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesJenkinsJenkinsPersistentTemplateJson = []byte(`{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "jenkins-persistent", + "creationTimestamp": null, + "annotations": { + "openshift.io/display-name": "Jenkins (Persistent)", + "description": "Jenkins service, with persistent storage.\n\nNOTE: You must have persistent volumes available in your cluster to use this template.", + "iconClass": "icon-jenkins", + "tags": "instant-app,jenkins", + "template.openshift.io/long-description": "This template deploys a Jenkins server capable of managing OpenShift Pipeline builds and supporting OpenShift-based oauth login.", + "template.openshift.io/provider-display-name": "Red Hat, Inc.", + "template.openshift.io/documentation-url": "https://docs.openshift.org/latest/using_images/other_images/jenkins.html", + "template.openshift.io/support-url": "https://access.redhat.com" + } + }, + "message": "A Jenkins service has been created in your project. Log into Jenkins with your OpenShift account. The tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.", + "objects": [ + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "to": { + "kind": "Service", + "name": "${JENKINS_SERVICE_NAME}" + }, + "tls": { + "termination": "edge", + "insecureEdgeTerminationPolicy": "Redirect" + } + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "${VOLUME_CAPACITY}" + } + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}", + "creationTimestamp": null + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "jenkins" + ], + "from": { + "kind": "ImageStreamTag", + "name": "${JENKINS_IMAGE_STREAM_TAG}", + "namespace": "${NAMESPACE}" + }, + "lastTriggeredImage": "" + } + }, + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "name": "${JENKINS_SERVICE_NAME}" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "name": "${JENKINS_SERVICE_NAME}" + } + }, + "spec": { + "serviceAccountName": "${JENKINS_SERVICE_NAME}", + "containers": [ + { + "name": "jenkins", + "image": " ", + "readinessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 3, + "httpGet": { + "path": "/login", + "port": 8080 + } + }, + "livenessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 420, + "failureThreshold" : 30, + "httpGet": { + "path": "/login", + "port": 8080 + } + }, + "env": [ + { + "name": "OPENSHIFT_ENABLE_OAUTH", + "value": "${ENABLE_OAUTH}" + }, + { + "name": "OPENSHIFT_ENABLE_REDIRECT_PROMPT", + "value": "true" + }, + { + "name": "OPENSHIFT_JENKINS_JVM_ARCH", + "value": "${JVM_ARCH}" + }, + { + "name": "KUBERNETES_MASTER", + "value": "https://kubernetes.default:443" + }, + { + "name": "KUBERNETES_TRUST_CERTIFICATES", + "value": "true" + }, + { + "name": "JNLP_SERVICE_NAME", + "value": "${JNLP_SERVICE_NAME}" + } + ], + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, + "volumeMounts": [ + { + "name": "${JENKINS_SERVICE_NAME}-data", + "mountPath": "/var/lib/jenkins" + } + ], + "terminationMessagePath": "/dev/termination-log", + "imagePullPolicy": "IfNotPresent", + "capabilities": {}, + "securityContext": { + "capabilities": {}, + "privileged": false + } + } + ], + "volumes": [ + { + "name": "${JENKINS_SERVICE_NAME}-data", + "persistentVolumeClaim": { + "claimName": "${JENKINS_SERVICE_NAME}" + } + } + ], + "restartPolicy": "Always", + "dnsPolicy": "ClusterFirst" + } + } + } + }, + { + "kind": "ServiceAccount", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}", + "annotations": { + "serviceaccounts.openshift.io/oauth-redirectreference.jenkins": "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"${JENKINS_SERVICE_NAME}\"}}" + } + } + }, + { + "kind": "RoleBinding", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}_edit" + }, + "groupNames": null, + "subjects": [ + { + "kind": "ServiceAccount", + "name": "${JENKINS_SERVICE_NAME}" + } + ], + "roleRef": { + "name": "edit" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${JNLP_SERVICE_NAME}" + }, + "spec": { + "ports": [ + { + "name": "agent", + "protocol": "TCP", + "port": 50000, + "targetPort": 50000, + "nodePort": 0 + } + ], + "selector": { + "name": "${JENKINS_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "${JENKINS_SERVICE_NAME}", + "annotations": { + "service.alpha.openshift.io/dependencies": "[{\"name\": \"${JNLP_SERVICE_NAME}\", \"namespace\": \"\", \"kind\": \"Service\"}]", + "service.openshift.io/infrastructure": "true" + }, + "creationTimestamp": null + }, + "spec": { + "ports": [ + { + "name": "web", + "protocol": "TCP", + "port": 80, + "targetPort": 8080, + "nodePort": 0 + } + ], + "selector": { + "name": "${JENKINS_SERVICE_NAME}" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + } + } + ], + "parameters": [ + { + "name": "JENKINS_SERVICE_NAME", + "displayName": "Jenkins Service Name", + "description": "The name of the OpenShift Service exposed for the Jenkins container.", + "value": "jenkins" + }, + { + "name": "JNLP_SERVICE_NAME", + "displayName": "Jenkins JNLP Service Name", + "description": "The name of the service used for master/slave communication.", + "value": "jenkins-jnlp" + }, + { + "name": "ENABLE_OAUTH", + "displayName": "Enable OAuth in Jenkins", + "description": "Whether to enable OAuth OpenShift integration. If false, the static account 'admin' will be initialized with the password 'password'.", + "value": "true" + }, + { + "name": "JVM_ARCH", + "displayName": "Jenkins JVM Architecture", + "description": "Whether Jenkins runs with a 32 bit (i386) or 64 bit (x86_64) JVM.", + "value": "i386" + }, + { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi" + }, + { + "name": "VOLUME_CAPACITY", + "displayName": "Volume Capacity", + "description": "Volume space available for data, e.g. 512Mi, 2Gi.", + "value": "1Gi", + "required": true + }, + { + "name": "NAMESPACE", + "displayName": "Jenkins ImageStream Namespace", + "description": "The OpenShift Namespace where the Jenkins ImageStream resides.", + "value": "openshift" + }, + { + "name": "JENKINS_IMAGE_STREAM_TAG", + "displayName": "Jenkins ImageStreamTag", + "description": "Name of the ImageStreamTag to be used for the Jenkins image.", + "value": "jenkins:latest" + } + ], + "labels": { + "template": "jenkins-persistent-template" + } +} +`) + +func examplesJenkinsJenkinsPersistentTemplateJsonBytes() ([]byte, error) { + return _examplesJenkinsJenkinsPersistentTemplateJson, nil +} + +func examplesJenkinsJenkinsPersistentTemplateJson() (*asset, error) { + bytes, err := examplesJenkinsJenkinsPersistentTemplateJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/jenkins/jenkins-persistent-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesJenkinsPipelineBluegreenPipelineYaml = []byte(`apiVersion: v1 +kind: Template +labels: + template: bluegreen-pipeline +message: A Jenkins server will be automatically instantiated in this project to manage + the Pipeline BuildConfig created by this template. You will be able to log in to + it using your OpenShift user credentials. +metadata: + annotations: + description: This example showcases a blue green deployment using a Jenkins + pipeline that pauses for approval. + iconClass: icon-jenkins + tags: instant-app,jenkins + name: bluegreen-pipeline +objects: +- apiVersion: v1 + kind: BuildConfig + metadata: + annotations: + pipeline.alpha.openshift.io/uses: '[{"name": "${NAME}", "namespace": "", "kind": "DeploymentConfig"}]' + creationTimestamp: null + labels: + name: bluegreen-pipeline + name: bluegreen-pipeline + spec: + strategy: + jenkinsPipelineStrategy: + jenkinsfile: |- + def appName="${NAME}" + def project="" + def tag="blue" + def altTag="green" + def verbose="${VERBOSE}" + + node { + project = env.PROJECT_NAME + stage("Initialize") { + sh "oc get route ${appName} -n ${project} -o jsonpath='{ .spec.to.name }' --loglevel=4 > activeservice" + activeService = readFile('activeservice').trim() + if (activeService == "${appName}-blue") { + tag = "green" + altTag = "blue" + } + sh "oc get route ${tag}-${appName} -n ${project} -o jsonpath='{ .spec.host }' --loglevel=4 > routehost" + routeHost = readFile('routehost').trim() + } + + stage("Build") { + echo "building tag ${tag}" + openshiftBuild buildConfig: appName, showBuildLogs: "true", verbose: verbose + } + + stage("Deploy Test") { + openshiftTag srcStream: appName, srcTag: 'latest', destinationStream: appName, destinationTag: tag, verbose: verbose + openshiftVerifyDeployment deploymentConfig: "${appName}-${tag}", verbose: verbose + } + + stage("Test") { + input message: "Test deployment: http://${routeHost}. Approve?", id: "approval" + } + + stage("Go Live") { + sh "oc set -n ${project} route-backends ${appName} ${appName}-${tag}=100 ${appName}-${altTag}=0 --loglevel=4" + } + } + type: JenkinsPipeline + triggers: + - github: + secret: "${GITHUB_WEBHOOK_SECRET}" + type: GitHub + - generic: + secret: "${GENERIC_WEBHOOK_SECRET}" + type: Generic +- apiVersion: v1 + kind: Route + metadata: + name: blue-${NAME} + spec: + to: + kind: Service + name: ${NAME}-blue +- apiVersion: v1 + kind: Route + metadata: + name: green-${NAME} + spec: + to: + kind: Service + name: ${NAME}-green +- apiVersion: v1 + kind: Route + metadata: + name: ${NAME} + spec: + alternateBackends: + - name: ${NAME}-green + weight: "0" + to: + kind: Service + name: ${NAME}-blue + weight: "100" +- apiVersion: v1 + kind: ImageStream + metadata: + annotations: + description: Keeps track of changes in the application image + name: ${NAME} +- apiVersion: v1 + kind: BuildConfig + metadata: + annotations: + description: Defines how to build the application + name: ${NAME} + spec: + output: + to: + kind: ImageStreamTag + name: ${NAME}:latest + postCommit: + script: npm test + source: + contextDir: ${CONTEXT_DIR} + git: + ref: ${SOURCE_REPOSITORY_REF} + uri: ${SOURCE_REPOSITORY_URL} + type: Git + strategy: + sourceStrategy: + env: + - name: NPM_MIRROR + value: ${NPM_MIRROR} + from: + kind: ImageStreamTag + name: nodejs:4 + namespace: ${NAMESPACE} + type: Source + triggers: + - github: + secret: ${GITHUB_WEBHOOK_SECRET} + type: GitHub + - generic: + secret: ${GENERIC_WEBHOOK_SECRET} + type: Generic +- apiVersion: v1 + kind: Service + metadata: + annotations: + service.alpha.openshift.io/dependencies: '[{"name": "${DATABASE_SERVICE_NAME}", "namespace": "", "kind": "Service"}]' + name: ${NAME}-blue + spec: + ports: + - name: web + port: 8080 + targetPort: 8080 + selector: + name: ${NAME}-blue +- apiVersion: v1 + kind: DeploymentConfig + metadata: + annotations: + description: Defines how to deploy the application server + name: ${NAME}-blue + spec: + replicas: 1 + selector: + name: ${NAME}-blue + strategy: + type: Rolling + template: + metadata: + labels: + name: ${NAME}-blue + name: ${NAME}-blue + spec: + containers: + - env: + - name: DATABASE_SERVICE_NAME + value: ${DATABASE_SERVICE_NAME} + - name: MONGODB_USER + value: ${DATABASE_USER} + - name: MONGODB_PASSWORD + value: ${DATABASE_PASSWORD} + - name: MONGODB_DATABASE + value: ${DATABASE_NAME} + - name: MONGODB_ADMIN_PASSWORD + value: ${DATABASE_ADMIN_PASSWORD} + image: ' ' + livenessProbe: + httpGet: + path: /pagecount + port: 8080 + initialDelaySeconds: 30 + timeoutSeconds: 3 + name: nodejs-mongodb-example + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /pagecount + port: 8080 + initialDelaySeconds: 3 + timeoutSeconds: 3 + resources: + limits: + memory: ${MEMORY_LIMIT} + triggers: + - imageChangeParams: + automatic: true + containerNames: + - nodejs-mongodb-example + from: + kind: ImageStreamTag + name: ${NAME}:blue + type: ImageChange + - type: ConfigChange +- apiVersion: v1 + kind: Service + metadata: + annotations: + service.alpha.openshift.io/dependencies: '[{"name": "${DATABASE_SERVICE_NAME}", "namespace": "", "kind": "Service"}]' + name: ${NAME}-green + spec: + ports: + - name: web + port: 8080 + targetPort: 8080 + selector: + name: ${NAME}-green +- apiVersion: v1 + kind: DeploymentConfig + metadata: + annotations: + description: Defines how to deploy the application server + name: ${NAME}-green + spec: + replicas: 1 + selector: + name: ${NAME}-green + strategy: + type: Rolling + template: + metadata: + labels: + name: ${NAME}-green + name: ${NAME}-green + spec: + containers: + - env: + - name: DATABASE_SERVICE_NAME + value: ${DATABASE_SERVICE_NAME} + - name: MONGODB_USER + value: ${DATABASE_USER} + - name: MONGODB_PASSWORD + value: ${DATABASE_PASSWORD} + - name: MONGODB_DATABASE + value: ${DATABASE_NAME} + - name: MONGODB_ADMIN_PASSWORD + value: ${DATABASE_ADMIN_PASSWORD} + image: ' ' + livenessProbe: + httpGet: + path: /pagecount + port: 8080 + initialDelaySeconds: 30 + timeoutSeconds: 3 + name: nodejs-mongodb-example + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /pagecount + port: 8080 + initialDelaySeconds: 3 + timeoutSeconds: 3 + resources: + limits: + memory: ${MEMORY_LIMIT} + triggers: + - imageChangeParams: + automatic: true + containerNames: + - nodejs-mongodb-example + from: + kind: ImageStreamTag + name: ${NAME}:green + type: ImageChange + - type: ConfigChange +- apiVersion: v1 + kind: Service + metadata: + annotations: + description: Exposes the database server + name: ${DATABASE_SERVICE_NAME} + spec: + ports: + - name: mongodb + port: 27017 + targetPort: 27017 + selector: + name: ${DATABASE_SERVICE_NAME} +- apiVersion: v1 + kind: DeploymentConfig + metadata: + annotations: + description: Defines how to deploy the database + name: ${DATABASE_SERVICE_NAME} + spec: + replicas: 1 + selector: + name: ${DATABASE_SERVICE_NAME} + strategy: + type: Recreate + template: + metadata: + labels: + name: ${DATABASE_SERVICE_NAME} + name: ${DATABASE_SERVICE_NAME} + spec: + containers: + - env: + - name: MONGODB_USER + value: ${DATABASE_USER} + - name: MONGODB_PASSWORD + value: ${DATABASE_PASSWORD} + - name: MONGODB_DATABASE + value: ${DATABASE_NAME} + - name: MONGODB_ADMIN_PASSWORD + value: ${DATABASE_ADMIN_PASSWORD} + image: ' ' + livenessProbe: + initialDelaySeconds: 30 + tcpSocket: + port: 27017 + timeoutSeconds: 1 + name: mongodb + ports: + - containerPort: 27017 + readinessProbe: + exec: + command: + - /bin/sh + - -i + - -c + - mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD + --eval="quit()" + initialDelaySeconds: 3 + timeoutSeconds: 1 + resources: + limits: + memory: ${MEMORY_MONGODB_LIMIT} + volumeMounts: + - mountPath: /var/lib/mongodb/data + name: ${DATABASE_SERVICE_NAME}-data + volumes: + - emptyDir: + medium: "" + name: ${DATABASE_SERVICE_NAME}-data + triggers: + - imageChangeParams: + automatic: true + containerNames: + - mongodb + from: + kind: ImageStreamTag + name: mongodb:3.2 + namespace: ${NAMESPACE} + type: ImageChange + - type: ConfigChange +parameters: +- description: The name assigned to all of the frontend objects defined in this template. + displayName: Name + name: NAME + required: true + value: nodejs-mongodb-example +- description: The exposed hostname that will route to the Node.js service, if left + blank a value will be defaulted. + displayName: Application Hostname + name: APPLICATION_DOMAIN +- description: The URL of the repository with your application source code. + displayName: Git Repository URL + name: SOURCE_REPOSITORY_URL + required: true + value: https://github.com/openshift/nodejs-ex.git +- description: The reference of the repository with your application source code. + displayName: Git Repository Ref + name: SOURCE_REPOSITORY_REF + required: true + value: master +- displayName: Database Name + name: DATABASE_NAME + required: true + value: sampledb +- description: Username for MongoDB user that will be used for accessing the database. + displayName: MongoDB Username + from: user[A-Z0-9]{3} + generate: expression + name: DATABASE_USER +- description: Password for the MongoDB user. + displayName: MongoDB Password + from: '[a-zA-Z0-9]{16}' + generate: expression + name: DATABASE_PASSWORD +- description: Maximum amount of memory the Node.js container can use. + displayName: Memory Limit + name: MEMORY_LIMIT + required: true + value: 512Mi +- description: Maximum amount of memory the MongoDB container can use. + displayName: Memory Limit (MongoDB) + name: MEMORY_MONGODB_LIMIT + required: true + value: 512Mi +- displayName: Database Service Name + name: DATABASE_SERVICE_NAME + required: true + value: mongodb +- description: Password for the database admin user. + displayName: Database Administrator Password + from: '[a-zA-Z0-9]{16}' + generate: expression + name: DATABASE_ADMIN_PASSWORD +- description: Set this to the relative path to your project if it is not in the root + of your repository. + displayName: Context Directory + name: CONTEXT_DIR +- description: A secret string used to configure the GitHub webhook. + displayName: GitHub Webhook Secret + from: '[a-zA-Z0-9]{40}' + generate: expression + name: GITHUB_WEBHOOK_SECRET +- description: A secret string used to configure the Generic webhook. + displayName: Generic Webhook Secret + from: '[a-zA-Z0-9]{40}' + generate: expression + name: GENERIC_WEBHOOK_SECRET +- description: The custom NPM mirror URL + displayName: Custom NPM Mirror URL + name: NPM_MIRROR +- description: The OpenShift Namespace where the NodeJS and MongoDB ImageStreams reside. + displayName: Namespace + name: NAMESPACE + required: true + value: openshift +- description: Whether to enable verbose logging of Jenkinsfile steps in pipeline + displayName: Verbose + name: VERBOSE + required: true + value: "false" +`) + +func examplesJenkinsPipelineBluegreenPipelineYamlBytes() ([]byte, error) { + return _examplesJenkinsPipelineBluegreenPipelineYaml, nil +} + +func examplesJenkinsPipelineBluegreenPipelineYaml() (*asset, error) { + bytes, err := examplesJenkinsPipelineBluegreenPipelineYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/jenkins/pipeline/bluegreen-pipeline.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesJenkinsPipelineMapsappPipelineYaml = []byte(`apiVersion: v1 +kind: Template +labels: + application: mapsapp-pipeline +metadata: + name: mapsapp-pipeline +parameters: +- description: NationalParks application source URI + displayName: NationalParks Source URI + name: NATIONALPARKS_GIT_URI + required: true + value: https://github.com/openshift-roadshow/nationalparks.git +- description: NationalParks application source reference + displayName: NationalParks Source Ref + name: NATIONALPARKS_GIT_REF + required: true + value: master +- description: MLBParks application source URI + displayName: MLBParks Source URI + name: MLBPARKS_GIT_URI + required: true + value: https://github.com/openshift-roadshow/mlbparks.git +- description: MLBParks application source reference + displayName: MLBParks Source Ref + name: MLBPARKS_GIT_REF + required: true + value: master +- description: ParksMap application source URI + displayName: ParksMap Source URI + name: PARKSMAP_GIT_URI + required: true + value: https://github.com/openshift-roadshow/parksmap-web.git +- description: ParksMap application source reference + displayName: ParksMap Source Ref + name: PARKSMAP_GIT_REF + required: true + value: master +- name: GITHUB_WEBHOOK_SECRET + displayName: GitHub Webhook Secret + description: A secret string used to configure the GitHub webhook. + generate: expression + from: "[a-zA-Z0-9]{40}" +- name: GENERIC_WEBHOOK_SECRET + displayName: Generic Webhook Secret, + description: A secret string used to configure the Generic webhook. + generate: expression + from: "[a-zA-Z0-9]{40}" +objects: +- apiVersion: v1 + kind: BuildConfig + metadata: + labels: + build: mapsapp-pipeline + name: mapsapp-pipeline + spec: + runPolicy: Serial + source: {} + strategy: + type: JenkinsPipeline + jenkinsPipelineStrategy: + jenkinsfile: |- + def project = "" + node { + project = "${env.PROJECT_NAME}" + + stage('Create NationalParks back-end') { + def nationalParksURL = "${NATIONALPARKS_GIT_URI}" + def nationalParksBranch = "${NATIONALPARKS_GIT_REF}" + checkout([$class: "GitSCM", branches: [[name: "*/${nationalParksBranch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: "RelativeTargetDirectory", relativeTargetDir: "nationalparks"]], submoduleCfg: [], userRemoteConfigs: [[url: "${nationalParksURL}"]]]) + sh "oc new-app -f nationalparks/ose3/pipeline-buildconfig-template.json -p GIT_URI=${nationalParksURL} -p GIT_REF=${nationalParksBranch} -n ${project} --dry-run -o yaml | oc apply -f - -n ${project}" + } + + stage('Create MLBParks back-end') { + def mlbParksURL = "${MLBPARKS_GIT_URI}" + def mlbParksBranch = "${MLBPARKS_GIT_REF}" + checkout([$class: "GitSCM", branches: [[name: "*/${mlbParksBranch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: "RelativeTargetDirectory", relativeTargetDir: "mlbparks"]], submoduleCfg: [], userRemoteConfigs: [[url: "${mlbParksURL}"]]]) + sh "oc new-app -f mlbparks/ose3/pipeline-buildconfig-template.json -p GIT_URI=${mlbParksURL} -p GIT_REF=${mlbParksBranch} -n ${project} --dry-run -o yaml | oc apply -f - -n ${project}" + } + + stage('Create ParksMap front-end') { + def parksMapURL = "${PARKSMAP_GIT_URI}" + def parksMapBranch = "${PARKSMAP_GIT_REF}" + checkout([$class: "GitSCM", branches: [[name: "*/${parksMapBranch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: "RelativeTargetDirectory", relativeTargetDir: "parksmap"]], submoduleCfg: [], userRemoteConfigs: [[url: "${parksMapURL}"]]]) + sh "oc new-app -f parksmap/ose3/pipeline-buildconfig-template.json -p GIT_URI=${parksMapURL} -p GIT_REF=${parksMapBranch} -n ${project} --dry-run -o yaml | oc apply -f - -n ${project}" + } + } + + stage('Build Back-ends') { + parallel ( + "nationalparks": { + node { + openshiftBuild buildConfig: "nationalparks-pipeline", namespace: project + } + }, + "mlbparks": { + node { + openshiftBuild buildConfig: "mlbparks-pipeline", namespace: project + } + } + ) + } + + node { + stage('Build Front-end') { + openshiftBuild buildConfig: "parksmap-pipeline", namespace: project + } + } + triggers: + - github: + secret: ${GITHUB_TRIGGER_SECRET} + type: GitHub + - generic: + secret: ${GENERIC_TRIGGER_SECRET} + type: Generic +`) + +func examplesJenkinsPipelineMapsappPipelineYamlBytes() ([]byte, error) { + return _examplesJenkinsPipelineMapsappPipelineYaml, nil +} + +func examplesJenkinsPipelineMapsappPipelineYaml() (*asset, error) { + bytes, err := examplesJenkinsPipelineMapsappPipelineYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/jenkins/pipeline/mapsapp-pipeline.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesJenkinsPipelineMavenPipelineYaml = []byte(`apiVersion: v1 +kind: Template +metadata: + name: maven-pipeline +parameters: +- name: APP_NAME + description: The name assigned to all of the application objects defined in this template. + displayName: Application Name + required: true + value: openshift-jee-sample +- name: GIT_SOURCE_URL + description: The source URL for the application + displayName: Source URL + required: true + value: https://github.com/bparees/openshift-jee-sample.git +- name: GIT_SOURCE_REF + description: The source Ref for the application + displayName: Source Ref + required: true + value: master +- description: A secret string used to configure the GitHub webhook. + displayName: GitHub Webhook Secret + from: '[a-zA-Z0-9]{40}' + generate: expression + name: GITHUB_WEBHOOK_SECRET + required: true +- description: A secret string used to configure the Generic webhook. + displayName: Generic Webhook Secret + from: '[a-zA-Z0-9]{40}' + generate: expression + name: GENERIC_WEBHOOK_SECRET + required: true +objects: +- apiVersion: v1 + kind: ImageStream + metadata: + labels: + app: ${APP_NAME} + name: ${APP_NAME} + spec: {} + status: + dockerImageRepository: "" +- apiVersion: v1 + kind: ImageStream + metadata: + name: wildfly + spec: + tags: + - annotations: + supports: wildfly:10.1,jee,java + tags: builder,wildfly,java + version: "10.1" + from: + kind: DockerImage + name: openshift/wildfly-101-centos7:latest + name: "10.1" + - annotations: + supports: jee,java + tags: builder,wildfly,java + from: + kind: ImageStreamTag + name: "10.1" + name: latest +- apiVersion: v1 + kind: BuildConfig + metadata: + annotations: + pipeline.alpha.openshift.io/uses: '[{"name": "${NAME}", "namespace": "", "kind": "DeploymentConfig"}]' + creationTimestamp: null + labels: + name: ${APP_NAME} + name: ${APP_NAME} + spec: + strategy: + jenkinsPipelineStrategy: + jenkinsfile: |- + def appName="${APP_NAME}" + def project="" + + node { + stage("Initialize") { + project = env.PROJECT_NAME + } + } + + node("maven") { + stage("Checkout") { + git url: "${GIT_SOURCE_URL}", branch: "${GIT_SOURCE_REF}" + } + stage("Build WAR") { + sh "mvn clean package -Popenshift" + stash name:"war", includes:"target/ROOT.war" + } + } + + node { + stage("Build Image") { + unstash name:"war" + sh "oc start-build ${appName}-docker --from-file=target/ROOT.war --follow -n ${project}" + } + stage("Deploy") { + openshiftDeploy deploymentConfig: appName, namespace: project + } + } + type: JenkinsPipeline + triggers: + - github: + secret: "${GITHUB_WEBHOOK_SECRET}" + type: GitHub + - generic: + secret: "${GENERIC_WEBHOOK_SECRET}" + type: Generic +- apiVersion: v1 + kind: BuildConfig + metadata: + labels: + app: ${APP_NAME}-docker + name: ${APP_NAME}-docker + spec: + output: + to: + kind: ImageStreamTag + name: ${APP_NAME}:latest + postCommit: {} + resources: {} + runPolicy: Serial + source: + dockerfile: |- + FROM wildfly + COPY ROOT.war /wildfly/standalone/deployments/ROOT.war + CMD $STI_SCRIPTS_PATH/run + binary: + asFile: ROOT.war + type: Docker + strategy: + dockerStrategy: + from: + kind: ImageStreamTag + name: wildfly:latest + type: Docker + triggers: {} +- apiVersion: v1 + kind: DeploymentConfig + metadata: + labels: + app: ${APP_NAME} + name: ${APP_NAME} + spec: + replicas: 1 + selector: + app: ${APP_NAME} + deploymentconfig: ${APP_NAME} + strategy: + rollingParams: + intervalSeconds: 1 + maxSurge: 25% + maxUnavailable: 25% + timeoutSeconds: 600 + updatePeriodSeconds: 1 + type: Rolling + template: + metadata: + labels: + app: ${APP_NAME} + deploymentconfig: ${APP_NAME} + spec: + containers: + - image: ${APP_NAME}:latest + imagePullPolicy: Always + name: ${APP_NAME} + ports: + - containerPort: 8080 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + livenessProbe: + httpGet: + path: / + port: 8080 + scheme: HTTP + initialDelaySeconds: 10 + timeoutSeconds: 2 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + httpGet: + path: / + port: 8080 + scheme: HTTP + initialDelaySeconds: 30 + timeoutSeconds: 2 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + dnsPolicy: ClusterFirst + restartPolicy: Always + securityContext: {} + terminationGracePeriodSeconds: 30 + test: false + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - ${APP_NAME} + from: + kind: ImageStreamTag + name: ${APP_NAME}:latest + type: ImageChange + status: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + openshift.io/generated-by: OpenShiftNewApp + labels: + app: ${APP_NAME} + name: ${APP_NAME} + spec: + ports: + - name: 8080-tcp + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: ${APP_NAME} + deploymentconfig: ${APP_NAME} + sessionAffinity: None + type: ClusterIP + status: + loadBalancer: {} +- apiVersion: v1 + kind: Route + metadata: + name: ${APP_NAME} + labels: + app: ${APP_NAME} + spec: + to: + kind: Service + name: ${APP_NAME} + weight: 100 + port: + targetPort: 8080-tcp + wildcardPolicy: None +`) + +func examplesJenkinsPipelineMavenPipelineYamlBytes() ([]byte, error) { + return _examplesJenkinsPipelineMavenPipelineYaml, nil +} + +func examplesJenkinsPipelineMavenPipelineYaml() (*asset, error) { + bytes, err := examplesJenkinsPipelineMavenPipelineYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/jenkins/pipeline/maven-pipeline.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesJenkinsPipelineOpenshiftClientPluginPipelineYaml = []byte(`apiVersion: v1 +kind: BuildConfig +metadata: + labels: + name: sample-pipeline-openshift-client-plugin + name: sample-pipeline-openshift-client-plugin +spec: + source: + type: Git + git: + uri: https://github.com/openshift/jenkins-client-plugin.git + strategy: + type: JenkinsPipeline + jenkinsPipelineStrategy: + jenkinsfilePath: examples/jenkins-image-sample.groovy +`) + +func examplesJenkinsPipelineOpenshiftClientPluginPipelineYamlBytes() ([]byte, error) { + return _examplesJenkinsPipelineOpenshiftClientPluginPipelineYaml, nil +} + +func examplesJenkinsPipelineOpenshiftClientPluginPipelineYaml() (*asset, error) { + bytes, err := examplesJenkinsPipelineOpenshiftClientPluginPipelineYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/jenkins/pipeline/openshift-client-plugin-pipeline.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _examplesJenkinsPipelineSamplepipelineYaml = []byte(`apiVersion: v1 +kind: Template +labels: + template: application-template-sample-pipeline +message: |- + A Jenkins server will be automatically instantiated in this project to manage + the Pipeline BuildConfig created by this template. You will be able to log in to + it using your OpenShift user credentials. +metadata: + annotations: + description: |- + This example showcases the new Jenkins Pipeline integration in OpenShift, + which performs continuous integration and deployment right on the platform. + The template contains a Jenkinsfile - a definition of a multi-stage CI/CD process - that + leverages the underlying OpenShift platform for dynamic and scalable + builds. OpenShift integrates the status of your pipeline builds into the web + console allowing you to see your entire application lifecycle in a single view. + iconClass: icon-jenkins + tags: instant-app,jenkins + name: jenkins-pipeline-example +parameters: +- description: The name assigned to all of the frontend objects defined in this template. + displayName: Name + name: NAME + required: true + value: nodejs-mongodb-example +- description: The exposed hostname that will route to the Node.js service, if left + blank a value will be defaulted. + displayName: Application Hostname + name: APPLICATION_DOMAIN +- description: The URL of the repository with your application source code. + displayName: Git Repository URL + name: SOURCE_REPOSITORY_URL + required: true + value: https://github.com/openshift/nodejs-ex.git +- displayName: Database Name + name: DATABASE_NAME + required: true + value: sampledb +- description: Username for MongoDB user that will be used for accessing the database. + displayName: MongoDB Username + from: user[A-Z0-9]{3} + generate: expression + name: DATABASE_USER +- description: Password for the MongoDB user. + displayName: MongoDB Password + from: '[a-zA-Z0-9]{16}' + generate: expression + name: DATABASE_PASSWORD +- description: Maximum amount of memory the Node.js container can use. + displayName: Memory Limit + name: MEMORY_LIMIT + required: true + value: 512Mi +- description: Maximum amount of memory the MongoDB container can use. + displayName: Memory Limit (MongoDB) + name: MEMORY_MONGODB_LIMIT + required: true + value: 512Mi +- displayName: Database Service Name + name: DATABASE_SERVICE_NAME + required: true + value: mongodb +- description: Password for the database admin user. + displayName: Database Administrator Password + from: '[a-zA-Z0-9]{16}' + generate: expression + name: DATABASE_ADMIN_PASSWORD +- description: Set this to a branch name, tag or other ref of your repository if you + are not using the default branch. + displayName: Git Reference + name: SOURCE_REPOSITORY_REF +- description: Set this to the relative path to your project if it is not in the root + of your repository. + displayName: Context Directory + name: CONTEXT_DIR +- description: A secret string used to configure the GitHub webhook. + displayName: GitHub Webhook Secret + from: '[a-zA-Z0-9]{40}' + generate: expression + name: GITHUB_WEBHOOK_SECRET +- description: A secret string used to configure the Generic webhook. + displayName: Generic Webhook Secret + from: '[a-zA-Z0-9]{40}' + generate: expression + name: GENERIC_WEBHOOK_SECRET +- description: The custom NPM mirror URL + displayName: Custom NPM Mirror URL + name: NPM_MIRROR +- description: The OpenShift Namespace where the NodeJS and MongoDB ImageStreams reside. + displayName: Namespace + name: NAMESPACE + required: true + value: openshift +objects: +- apiVersion: v1 + kind: BuildConfig + metadata: + annotations: + pipeline.alpha.openshift.io/uses: '[{"name": "${NAME}", "namespace": "", "kind": "DeploymentConfig"}]' + labels: + name: sample-pipeline + name: sample-pipeline + spec: + strategy: + jenkinsPipelineStrategy: + jenkinsfile: |- + node('nodejs') { + stage('build') { + openshiftBuild(buildConfig: '${NAME}', showBuildLogs: 'true') + } + stage('deploy') { + openshiftDeploy(deploymentConfig: '${NAME}') + } + } + type: JenkinsPipeline + triggers: + - github: + secret: secret101 + type: GitHub + - generic: + secret: secret101 + type: Generic +- apiVersion: v1 + kind: Service + metadata: + annotations: + service.alpha.openshift.io/dependencies: '[{"name": "${DATABASE_SERVICE_NAME}", "namespace": "", "kind": "Service"}]' + name: ${NAME} + spec: + ports: + - name: web + port: 8080 + targetPort: 8080 + selector: + name: ${NAME} +- apiVersion: v1 + kind: Route + metadata: + name: ${NAME} + spec: + host: ${APPLICATION_DOMAIN} + to: + kind: Service + name: ${NAME} +- apiVersion: v1 + kind: ImageStream + metadata: + annotations: + description: Keeps track of changes in the application image + name: ${NAME} +- apiVersion: v1 + kind: BuildConfig + metadata: + annotations: + description: Defines how to build the application + name: ${NAME} + spec: + output: + to: + kind: ImageStreamTag + name: ${NAME}:latest + postCommit: + script: npm test + source: + contextDir: ${CONTEXT_DIR} + git: + ref: ${SOURCE_REPOSITORY_REF} + uri: ${SOURCE_REPOSITORY_URL} + type: Git + strategy: + sourceStrategy: + env: + - name: NPM_MIRROR + value: ${NPM_MIRROR} + from: + kind: ImageStreamTag + name: nodejs:4 + namespace: ${NAMESPACE} + type: Source + triggers: + - github: + secret: ${GITHUB_WEBHOOK_SECRET} + type: GitHub + - generic: + secret: ${GENERIC_WEBHOOK_SECRET} + type: Generic +- apiVersion: v1 + kind: DeploymentConfig + metadata: + annotations: + description: Defines how to deploy the application server + name: ${NAME} + spec: + replicas: 1 + selector: + name: ${NAME} + strategy: + type: Rolling + template: + metadata: + labels: + name: ${NAME} + name: ${NAME} + spec: + containers: + - env: + - name: DATABASE_SERVICE_NAME + value: ${DATABASE_SERVICE_NAME} + - name: MONGODB_USER + value: ${DATABASE_USER} + - name: MONGODB_PASSWORD + value: ${DATABASE_PASSWORD} + - name: MONGODB_DATABASE + value: ${DATABASE_NAME} + - name: MONGODB_ADMIN_PASSWORD + value: ${DATABASE_ADMIN_PASSWORD} + image: ' ' + livenessProbe: + httpGet: + path: /pagecount + port: 8080 + initialDelaySeconds: 30 + timeoutSeconds: 3 + name: nodejs-mongodb-example + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /pagecount + port: 8080 + initialDelaySeconds: 3 + timeoutSeconds: 3 + resources: + limits: + memory: ${MEMORY_LIMIT} + triggers: + - imageChangeParams: + automatic: false + containerNames: + - nodejs-mongodb-example + from: + kind: ImageStreamTag + name: ${NAME}:latest + type: ImageChange + - type: ConfigChange +- apiVersion: v1 + kind: Service + metadata: + annotations: + description: Exposes the database server + name: ${DATABASE_SERVICE_NAME} + spec: + ports: + - name: mongodb + port: 27017 + targetPort: 27017 + selector: + name: ${DATABASE_SERVICE_NAME} +- apiVersion: v1 + kind: DeploymentConfig + metadata: + annotations: + description: Defines how to deploy the database + name: ${DATABASE_SERVICE_NAME} + spec: + replicas: 1 + selector: + name: ${DATABASE_SERVICE_NAME} + strategy: + type: Recreate + template: + metadata: + labels: + name: ${DATABASE_SERVICE_NAME} + name: ${DATABASE_SERVICE_NAME} + spec: + containers: + - env: + - name: MONGODB_USER + value: ${DATABASE_USER} + - name: MONGODB_PASSWORD + value: ${DATABASE_PASSWORD} + - name: MONGODB_DATABASE + value: ${DATABASE_NAME} + - name: MONGODB_ADMIN_PASSWORD + value: ${DATABASE_ADMIN_PASSWORD} + image: ' ' + livenessProbe: + initialDelaySeconds: 30 + tcpSocket: + port: 27017 + timeoutSeconds: 1 + name: mongodb + ports: + - containerPort: 27017 + readinessProbe: + exec: + command: + - /bin/sh + - -i + - -c + - mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD + --eval="quit()" + initialDelaySeconds: 3 + timeoutSeconds: 1 + resources: + limits: + memory: ${MEMORY_MONGODB_LIMIT} + volumeMounts: + - mountPath: /var/lib/mongodb/data + name: ${DATABASE_SERVICE_NAME}-data + volumes: + - emptyDir: + medium: "" + name: ${DATABASE_SERVICE_NAME}-data + triggers: + - imageChangeParams: + automatic: true + containerNames: + - mongodb + from: + kind: ImageStreamTag + name: mongodb:3.2 + namespace: ${NAMESPACE} + type: ImageChange + - type: ConfigChange +`) + +func examplesJenkinsPipelineSamplepipelineYamlBytes() ([]byte, error) { + return _examplesJenkinsPipelineSamplepipelineYaml, nil +} + +func examplesJenkinsPipelineSamplepipelineYaml() (*asset, error) { + bytes, err := examplesJenkinsPipelineSamplepipelineYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "examples/jenkins/pipeline/samplepipeline.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +// Asset loads and returns the asset for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func Asset(name string) ([]byte, error) { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) + } + return a.bytes, nil + } + return nil, fmt.Errorf("Asset %s not found", name) +} + +// MustAsset is like Asset but panics when Asset would return an error. +// It simplifies safe initialization of global variables. +func MustAsset(name string) []byte { + a, err := Asset(name) + if err != nil { + panic("asset: Asset(" + name + "): " + err.Error()) + } + + return a +} + +// AssetInfo loads and returns the asset info for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func AssetInfo(name string) (os.FileInfo, error) { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) + } + return a.info, nil + } + return nil, fmt.Errorf("AssetInfo %s not found", name) +} + +// AssetNames returns the names of the assets. +func AssetNames() []string { + names := make([]string, 0, len(_bindata)) + for name := range _bindata { + names = append(names, name) + } + return names +} + +// _bindata is a table, holding each asset generator, mapped to its name. +var _bindata = map[string]func() (*asset, error){ + "test/extended/testdata/build-extended/bc-scripts-by-url.yaml": testExtendedTestdataBuildExtendedBcScriptsByUrlYaml, + "test/extended/testdata/build-extended/bc-scripts-in-repo.yaml": testExtendedTestdataBuildExtendedBcScriptsInRepoYaml, + "test/extended/testdata/build-extended/bc-scripts-in-the-image.yaml": testExtendedTestdataBuildExtendedBcScriptsInTheImageYaml, + "test/extended/testdata/build-extended/jvm-runner-with-scripts.yaml": testExtendedTestdataBuildExtendedJvmRunnerWithScriptsYaml, + "test/extended/testdata/build-extended/jvm-runner.yaml": testExtendedTestdataBuildExtendedJvmRunnerYaml, + "test/extended/testdata/build-quota/.s2i/bin/assemble": testExtendedTestdataBuildQuotaS2iBinAssemble, + "test/extended/testdata/build-quota/Dockerfile": testExtendedTestdataBuildQuotaDockerfile, + "test/extended/testdata/build-secrets/Dockerfile": testExtendedTestdataBuildSecretsDockerfile, + "test/extended/testdata/build-secrets/s2i-binary-dir/.s2i/bin/assemble": testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinAssemble, + "test/extended/testdata/build-secrets/s2i-binary-dir/.s2i/bin/run": testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinRun, + "test/extended/testdata/build-secrets/s2i-binary-dir/Gemfile": testExtendedTestdataBuildSecretsS2iBinaryDirGemfile, + "test/extended/testdata/build-secrets/s2i-binary-dir/config.ru": testExtendedTestdataBuildSecretsS2iBinaryDirConfigRu, + "test/extended/testdata/build-secrets/test-docker-build.json": testExtendedTestdataBuildSecretsTestDockerBuildJson, + "test/extended/testdata/build-secrets/test-is.json": testExtendedTestdataBuildSecretsTestIsJson, + "test/extended/testdata/build-secrets/test-s2i-build.json": testExtendedTestdataBuildSecretsTestS2iBuildJson, + "test/extended/testdata/build-secrets/test-secret-2.json": testExtendedTestdataBuildSecretsTestSecret2Json, + "test/extended/testdata/build-secrets/test-secret.json": testExtendedTestdataBuildSecretsTestSecretJson, + "test/extended/testdata/custom-secret-builder/Dockerfile": testExtendedTestdataCustomSecretBuilderDockerfile, + "test/extended/testdata/custom-secret-builder/build.sh": testExtendedTestdataCustomSecretBuilderBuildSh, + "test/extended/testdata/deployments/custom-deployment.yaml": testExtendedTestdataDeploymentsCustomDeploymentYaml, + "test/extended/testdata/deployments/deployment-example.yaml": testExtendedTestdataDeploymentsDeploymentExampleYaml, + "test/extended/testdata/deployments/deployment-history-limit.yaml": testExtendedTestdataDeploymentsDeploymentHistoryLimitYaml, + "test/extended/testdata/deployments/deployment-ignores-deployer.yaml": testExtendedTestdataDeploymentsDeploymentIgnoresDeployerYaml, + "test/extended/testdata/deployments/deployment-image-resolution.yaml": testExtendedTestdataDeploymentsDeploymentImageResolutionYaml, + "test/extended/testdata/deployments/deployment-min-ready-seconds.yaml": testExtendedTestdataDeploymentsDeploymentMinReadySecondsYaml, + "test/extended/testdata/deployments/deployment-simple.yaml": testExtendedTestdataDeploymentsDeploymentSimpleYaml, + "test/extended/testdata/deployments/deployment-with-ref-env.yaml": testExtendedTestdataDeploymentsDeploymentWithRefEnvYaml, + "test/extended/testdata/deployments/failing-pre-hook.yaml": testExtendedTestdataDeploymentsFailingPreHookYaml, + "test/extended/testdata/deployments/generation-test.yaml": testExtendedTestdataDeploymentsGenerationTestYaml, + "test/extended/testdata/deployments/multi-ict-deployment.yaml": testExtendedTestdataDeploymentsMultiIctDeploymentYaml, + "test/extended/testdata/deployments/paused-deployment.yaml": testExtendedTestdataDeploymentsPausedDeploymentYaml, + "test/extended/testdata/deployments/readiness-test.yaml": testExtendedTestdataDeploymentsReadinessTestYaml, + "test/extended/testdata/deployments/tag-images-deployment.yaml": testExtendedTestdataDeploymentsTagImagesDeploymentYaml, + "test/extended/testdata/deployments/test-deployment-broken.yaml": testExtendedTestdataDeploymentsTestDeploymentBrokenYaml, + "test/extended/testdata/deployments/test-deployment-test.yaml": testExtendedTestdataDeploymentsTestDeploymentTestYaml, + "test/extended/testdata/forcepull-test.json": testExtendedTestdataForcepullTestJson, + "test/extended/testdata/gssapi/config/kubeconfig": testExtendedTestdataGssapiConfigKubeconfig, + "test/extended/testdata/gssapi/config/oauth_config.json": testExtendedTestdataGssapiConfigOauth_configJson, + "test/extended/testdata/gssapi/fedora/base/Dockerfile": testExtendedTestdataGssapiFedoraBaseDockerfile, + "test/extended/testdata/gssapi/fedora/kerberos/Dockerfile": testExtendedTestdataGssapiFedoraKerberosDockerfile, + "test/extended/testdata/gssapi/fedora/kerberos_configured/Dockerfile": testExtendedTestdataGssapiFedoraKerberos_configuredDockerfile, + "test/extended/testdata/gssapi/proxy/Dockerfile": testExtendedTestdataGssapiProxyDockerfile, + "test/extended/testdata/gssapi/proxy/configure.sh": testExtendedTestdataGssapiProxyConfigureSh, + "test/extended/testdata/gssapi/proxy/gssapiproxy-buildconfig.yaml": testExtendedTestdataGssapiProxyGssapiproxyBuildconfigYaml, + "test/extended/testdata/gssapi/proxy/gssapiproxy-deploymentconfig.yaml": testExtendedTestdataGssapiProxyGssapiproxyDeploymentconfigYaml, + "test/extended/testdata/gssapi/proxy/gssapiproxy-imagestream.yaml": testExtendedTestdataGssapiProxyGssapiproxyImagestreamYaml, + "test/extended/testdata/gssapi/proxy/gssapiproxy-service.yaml": testExtendedTestdataGssapiProxyGssapiproxyServiceYaml, + "test/extended/testdata/gssapi/proxy/healthz": testExtendedTestdataGssapiProxyHealthz, + "test/extended/testdata/gssapi/proxy/kadm5.acl": testExtendedTestdataGssapiProxyKadm5Acl, + "test/extended/testdata/gssapi/proxy/kdc.conf": testExtendedTestdataGssapiProxyKdcConf, + "test/extended/testdata/gssapi/proxy/krb5.conf": testExtendedTestdataGssapiProxyKrb5Conf, + "test/extended/testdata/gssapi/proxy/proxy.conf": testExtendedTestdataGssapiProxyProxyConf, + "test/extended/testdata/gssapi/scripts/gssapi-tests.sh": testExtendedTestdataGssapiScriptsGssapiTestsSh, + "test/extended/testdata/gssapi/scripts/test-wrapper.sh": testExtendedTestdataGssapiScriptsTestWrapperSh, + "test/extended/testdata/gssapi/ubuntu/base/Dockerfile": testExtendedTestdataGssapiUbuntuBaseDockerfile, + "test/extended/testdata/gssapi/ubuntu/kerberos/Dockerfile": testExtendedTestdataGssapiUbuntuKerberosDockerfile, + "test/extended/testdata/gssapi/ubuntu/kerberos_configured/Dockerfile": testExtendedTestdataGssapiUbuntuKerberos_configuredDockerfile, + "test/extended/testdata/hello-builder/Dockerfile": testExtendedTestdataHelloBuilderDockerfile, + "test/extended/testdata/hello-builder/scripts/assemble": testExtendedTestdataHelloBuilderScriptsAssemble, + "test/extended/testdata/hello-builder/scripts/run": testExtendedTestdataHelloBuilderScriptsRun, + "test/extended/testdata/idling-echo-server-rc.yaml": testExtendedTestdataIdlingEchoServerRcYaml, + "test/extended/testdata/idling-echo-server.yaml": testExtendedTestdataIdlingEchoServerYaml, + "test/extended/testdata/image-pull-secrets/dc-with-new-pull-secret.yaml": testExtendedTestdataImagePullSecretsDcWithNewPullSecretYaml, + "test/extended/testdata/image-pull-secrets/dc-with-old-pull-secret.yaml": testExtendedTestdataImagePullSecretsDcWithOldPullSecretYaml, + "test/extended/testdata/image-pull-secrets/pod-with-new-pull-secret.yaml": testExtendedTestdataImagePullSecretsPodWithNewPullSecretYaml, + "test/extended/testdata/image-pull-secrets/pod-with-no-pull-secret.yaml": testExtendedTestdataImagePullSecretsPodWithNoPullSecretYaml, + "test/extended/testdata/image-pull-secrets/pod-with-old-pull-secret.yaml": testExtendedTestdataImagePullSecretsPodWithOldPullSecretYaml, + "test/extended/testdata/incremental-auth-build.json": testExtendedTestdataIncrementalAuthBuildJson, + "test/extended/testdata/jenkins-plugin/build-job-clone.xml": testExtendedTestdataJenkinsPluginBuildJobCloneXml, + "test/extended/testdata/jenkins-plugin/build-job-slave.xml": testExtendedTestdataJenkinsPluginBuildJobSlaveXml, + "test/extended/testdata/jenkins-plugin/build-job.xml": testExtendedTestdataJenkinsPluginBuildJobXml, + "test/extended/testdata/jenkins-plugin/build-with-env-job.xml": testExtendedTestdataJenkinsPluginBuildWithEnvJobXml, + "test/extended/testdata/jenkins-plugin/build-with-exec-steps.xml": testExtendedTestdataJenkinsPluginBuildWithExecStepsXml, + "test/extended/testdata/jenkins-plugin/create-job.xml": testExtendedTestdataJenkinsPluginCreateJobXml, + "test/extended/testdata/jenkins-plugin/delete-job-keys.xml": testExtendedTestdataJenkinsPluginDeleteJobKeysXml, + "test/extended/testdata/jenkins-plugin/delete-job-labels.xml": testExtendedTestdataJenkinsPluginDeleteJobLabelsXml, + "test/extended/testdata/jenkins-plugin/delete-job.xml": testExtendedTestdataJenkinsPluginDeleteJobXml, + "test/extended/testdata/jenkins-plugin/imagestream-scm-dsl-job.xml": testExtendedTestdataJenkinsPluginImagestreamScmDslJobXml, + "test/extended/testdata/jenkins-plugin/imagestream-scm-job.xml": testExtendedTestdataJenkinsPluginImagestreamScmJobXml, + "test/extended/testdata/jenkins-plugin/multitag-job.xml": testExtendedTestdataJenkinsPluginMultitagJobXml, + "test/extended/testdata/jenkins-plugin/multitag-template.json": testExtendedTestdataJenkinsPluginMultitagTemplateJson, + "test/extended/testdata/jenkins-plugin/shared-resources-template.json": testExtendedTestdataJenkinsPluginSharedResourcesTemplateJson, + "test/extended/testdata/jobs/v1.yaml": testExtendedTestdataJobsV1Yaml, + "test/extended/testdata/jobs/v1beta1.yaml": testExtendedTestdataJobsV1beta1Yaml, + "test/extended/testdata/ldap/ldapserver-buildconfig.json": testExtendedTestdataLdapLdapserverBuildconfigJson, + "test/extended/testdata/ldap/ldapserver-deploymentconfig.json": testExtendedTestdataLdapLdapserverDeploymentconfigJson, + "test/extended/testdata/ldap/ldapserver-imagestream-testenv.json": testExtendedTestdataLdapLdapserverImagestreamTestenvJson, + "test/extended/testdata/ldap/ldapserver-imagestream.json": testExtendedTestdataLdapLdapserverImagestreamJson, + "test/extended/testdata/ldap/ldapserver-service.json": testExtendedTestdataLdapLdapserverServiceJson, + "test/extended/testdata/long_names/Dockerfile": testExtendedTestdataLong_namesDockerfile, + "test/extended/testdata/long_names/fixture.json": testExtendedTestdataLong_namesFixtureJson, + "test/extended/testdata/roles/empty-role.yaml": testExtendedTestdataRolesEmptyRoleYaml, + "test/extended/testdata/roles/policy-clusterroles.yaml": testExtendedTestdataRolesPolicyClusterrolesYaml, + "test/extended/testdata/roles/policy-roles.yaml": testExtendedTestdataRolesPolicyRolesYaml, + "test/extended/testdata/run_policy/parallel-bc.yaml": testExtendedTestdataRun_policyParallelBcYaml, + "test/extended/testdata/run_policy/serial-bc.yaml": testExtendedTestdataRun_policySerialBcYaml, + "test/extended/testdata/run_policy/serial-latest-only-bc.yaml": testExtendedTestdataRun_policySerialLatestOnlyBcYaml, + "test/extended/testdata/s2i-dropcaps/root-access-build.yaml": testExtendedTestdataS2iDropcapsRootAccessBuildYaml, + "test/extended/testdata/s2i-dropcaps/rootable-ruby/Dockerfile": testExtendedTestdataS2iDropcapsRootableRubyDockerfile, + "test/extended/testdata/s2i-dropcaps/rootable-ruby/adduser": testExtendedTestdataS2iDropcapsRootableRubyAdduser, + "test/extended/testdata/s2i-dropcaps/rootable-ruby/assemble": testExtendedTestdataS2iDropcapsRootableRubyAssemble, + "test/extended/testdata/sample-image-stream.json": testExtendedTestdataSampleImageStreamJson, + "test/extended/testdata/scoped-router.yaml": testExtendedTestdataScopedRouterYaml, + "test/extended/testdata/service-serving-cert/nginx-serving-cert.conf": testExtendedTestdataServiceServingCertNginxServingCertConf, + "test/extended/testdata/statusfail-assemble/.s2i/bin/assemble": testExtendedTestdataStatusfailAssembleS2iBinAssemble, + "test/extended/testdata/statusfail-failedassemble.yaml": testExtendedTestdataStatusfailFailedassembleYaml, + "test/extended/testdata/statusfail-fetchbuilderimage.yaml": testExtendedTestdataStatusfailFetchbuilderimageYaml, + "test/extended/testdata/statusfail-fetchsourcedocker.yaml": testExtendedTestdataStatusfailFetchsourcedockerYaml, + "test/extended/testdata/statusfail-fetchsources2i.yaml": testExtendedTestdataStatusfailFetchsources2iYaml, + "test/extended/testdata/statusfail-postcommithook.yaml": testExtendedTestdataStatusfailPostcommithookYaml, + "test/extended/testdata/statusfail-pushtoregistry.yaml": testExtendedTestdataStatusfailPushtoregistryYaml, + "test/extended/testdata/statusfail-runtimeartifacts.yaml": testExtendedTestdataStatusfailRuntimeartifactsYaml, + "test/extended/testdata/sti-environment-build-app/.sti/environment": testExtendedTestdataStiEnvironmentBuildAppStiEnvironment, + "test/extended/testdata/sti-environment-build-app/Gemfile": testExtendedTestdataStiEnvironmentBuildAppGemfile, + "test/extended/testdata/sti-environment-build-app/config.ru": testExtendedTestdataStiEnvironmentBuildAppConfigRu, + "test/extended/testdata/test-auth-build.yaml": testExtendedTestdataTestAuthBuildYaml, + "test/extended/testdata/test-build-app/Dockerfile": testExtendedTestdataTestBuildAppDockerfile, + "test/extended/testdata/test-build-app/Gemfile": testExtendedTestdataTestBuildAppGemfile, + "test/extended/testdata/test-build-app/config.ru": testExtendedTestdataTestBuildAppConfigRu, + "test/extended/testdata/test-build-podsvc.json": testExtendedTestdataTestBuildPodsvcJson, + "test/extended/testdata/test-build-postcommit.json": testExtendedTestdataTestBuildPostcommitJson, + "test/extended/testdata/test-build-proxy.json": testExtendedTestdataTestBuildProxyJson, + "test/extended/testdata/test-build-revision.json": testExtendedTestdataTestBuildRevisionJson, + "test/extended/testdata/test-build.json": testExtendedTestdataTestBuildJson, + "test/extended/testdata/test-buildconfigsecretinjector.yaml": testExtendedTestdataTestBuildconfigsecretinjectorYaml, + "test/extended/testdata/test-cds-dockerbuild.json": testExtendedTestdataTestCdsDockerbuildJson, + "test/extended/testdata/test-cds-sourcebuild.json": testExtendedTestdataTestCdsSourcebuildJson, + "test/extended/testdata/test-cli-debug.yaml": testExtendedTestdataTestCliDebugYaml, + "test/extended/testdata/test-context-build.json": testExtendedTestdataTestContextBuildJson, + "test/extended/testdata/test-custom-build.json": testExtendedTestdataTestCustomBuildJson, + "test/extended/testdata/test-docker-build-pullsecret.json": testExtendedTestdataTestDockerBuildPullsecretJson, + "test/extended/testdata/test-docker-build-quota.json": testExtendedTestdataTestDockerBuildQuotaJson, + "test/extended/testdata/test-docker-build.json": testExtendedTestdataTestDockerBuildJson, + "test/extended/testdata/test-docker-no-outputname.json": testExtendedTestdataTestDockerNoOutputnameJson, + "test/extended/testdata/test-env-build.json": testExtendedTestdataTestEnvBuildJson, + "test/extended/testdata/test-env-pod.json": testExtendedTestdataTestEnvPodJson, + "test/extended/testdata/test-gitserver-tokenauth.yaml": testExtendedTestdataTestGitserverTokenauthYaml, + "test/extended/testdata/test-gitserver.yaml": testExtendedTestdataTestGitserverYaml, + "test/extended/testdata/test-imagesource-build.yaml": testExtendedTestdataTestImagesourceBuildYaml, + "test/extended/testdata/test-nosrc-build.json": testExtendedTestdataTestNosrcBuildJson, + "test/extended/testdata/test-s2i-build-quota.json": testExtendedTestdataTestS2iBuildQuotaJson, + "test/extended/testdata/test-s2i-build.json": testExtendedTestdataTestS2iBuildJson, + "test/extended/testdata/test-s2i-no-outputname.json": testExtendedTestdataTestS2iNoOutputnameJson, + "test/extended/testdata/test-secret-build.json": testExtendedTestdataTestSecretBuildJson, + "test/extended/testdata/test-secret.json": testExtendedTestdataTestSecretJson, + "test/extended/testdata/weighted-router.yaml": testExtendedTestdataWeightedRouterYaml, + "test/integration/testdata/project-request-template-with-quota.yaml": testIntegrationTestdataProjectRequestTemplateWithQuotaYaml, + "test/integration/testdata/test-buildcli-beta2.json": testIntegrationTestdataTestBuildcliBeta2Json, + "test/integration/testdata/test-buildcli.json": testIntegrationTestdataTestBuildcliJson, + "test/integration/testdata/test-deployment-config.yaml": testIntegrationTestdataTestDeploymentConfigYaml, + "test/integration/testdata/test-egress-network-policy.json": testIntegrationTestdataTestEgressNetworkPolicyJson, + "test/integration/testdata/test-image-stream-mapping.json": testIntegrationTestdataTestImageStreamMappingJson, + "test/integration/testdata/test-image-stream.json": testIntegrationTestdataTestImageStreamJson, + "test/integration/testdata/test-image.json": testIntegrationTestdataTestImageJson, + "test/integration/testdata/test-route.json": testIntegrationTestdataTestRouteJson, + "test/integration/testdata/test-service-with-finalizer.json": testIntegrationTestdataTestServiceWithFinalizerJson, + "test/integration/testdata/test-service.json": testIntegrationTestdataTestServiceJson, + "examples/db-templates/mariadb-ephemeral-template.json": examplesDbTemplatesMariadbEphemeralTemplateJson, + "examples/db-templates/mariadb-persistent-template.json": examplesDbTemplatesMariadbPersistentTemplateJson, + "examples/db-templates/mongodb-ephemeral-template.json": examplesDbTemplatesMongodbEphemeralTemplateJson, + "examples/db-templates/mongodb-persistent-template.json": examplesDbTemplatesMongodbPersistentTemplateJson, + "examples/db-templates/mysql-ephemeral-template.json": examplesDbTemplatesMysqlEphemeralTemplateJson, + "examples/db-templates/mysql-persistent-template.json": examplesDbTemplatesMysqlPersistentTemplateJson, + "examples/db-templates/postgresql-ephemeral-template.json": examplesDbTemplatesPostgresqlEphemeralTemplateJson, + "examples/db-templates/postgresql-persistent-template.json": examplesDbTemplatesPostgresqlPersistentTemplateJson, + "examples/db-templates/redis-ephemeral-template.json": examplesDbTemplatesRedisEphemeralTemplateJson, + "examples/db-templates/redis-persistent-template.json": examplesDbTemplatesRedisPersistentTemplateJson, + "examples/image-streams/image-streams-centos7.json": examplesImageStreamsImageStreamsCentos7Json, + "examples/image-streams/image-streams-rhel7.json": examplesImageStreamsImageStreamsRhel7Json, + "examples/sample-app/application-template-custombuild.json": examplesSampleAppApplicationTemplateCustombuildJson, + "examples/sample-app/application-template-dockerbuild.json": examplesSampleAppApplicationTemplateDockerbuildJson, + "examples/sample-app/application-template-pullspecbuild.json": examplesSampleAppApplicationTemplatePullspecbuildJson, + "examples/sample-app/application-template-stibuild.json": examplesSampleAppApplicationTemplateStibuildJson, + "examples/sample-app/cleanup.sh": examplesSampleAppCleanupSh, + "examples/sample-app/github-webhook-example.json": examplesSampleAppGithubWebhookExampleJson, + "examples/sample-app/pullimages.sh": examplesSampleAppPullimagesSh, + "examples/hello-openshift/Dockerfile": examplesHelloOpenshiftDockerfile, + "examples/hello-openshift/hello-pod.json": examplesHelloOpenshiftHelloPodJson, + "examples/hello-openshift/hello-project.json": examplesHelloOpenshiftHelloProjectJson, + "examples/jenkins/application-template.json": examplesJenkinsApplicationTemplateJson, + "examples/jenkins/jenkins-ephemeral-template.json": examplesJenkinsJenkinsEphemeralTemplateJson, + "examples/jenkins/jenkins-persistent-template.json": examplesJenkinsJenkinsPersistentTemplateJson, + "examples/jenkins/pipeline/bluegreen-pipeline.yaml": examplesJenkinsPipelineBluegreenPipelineYaml, + "examples/jenkins/pipeline/mapsapp-pipeline.yaml": examplesJenkinsPipelineMapsappPipelineYaml, + "examples/jenkins/pipeline/maven-pipeline.yaml": examplesJenkinsPipelineMavenPipelineYaml, + "examples/jenkins/pipeline/openshift-client-plugin-pipeline.yaml": examplesJenkinsPipelineOpenshiftClientPluginPipelineYaml, + "examples/jenkins/pipeline/samplepipeline.yaml": examplesJenkinsPipelineSamplepipelineYaml, +} + +// AssetDir returns the file names below a certain +// directory embedded in the file by go-bindata. +// For example if you run go-bindata on data/... and data contains the +// following hierarchy: +// data/ +// foo.txt +// img/ +// a.png +// b.png +// then AssetDir("data") would return []string{"foo.txt", "img"} +// AssetDir("data/img") would return []string{"a.png", "b.png"} +// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// AssetDir("") will return []string{"data"}. +func AssetDir(name string) ([]string, error) { + node := _bintree + if len(name) != 0 { + cannonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(cannonicalName, "/") + for _, p := range pathList { + node = node.Children[p] + if node == nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + } + } + if node.Func != nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + rv := make([]string, 0, len(node.Children)) + for childName := range node.Children { + rv = append(rv, childName) + } + return rv, nil +} + +type bintree struct { + Func func() (*asset, error) + Children map[string]*bintree +} +var _bintree = &bintree{nil, map[string]*bintree{ + "examples": &bintree{nil, map[string]*bintree{ + "db-templates": &bintree{nil, map[string]*bintree{ + "mariadb-ephemeral-template.json": &bintree{examplesDbTemplatesMariadbEphemeralTemplateJson, map[string]*bintree{}}, + "mariadb-persistent-template.json": &bintree{examplesDbTemplatesMariadbPersistentTemplateJson, map[string]*bintree{}}, + "mongodb-ephemeral-template.json": &bintree{examplesDbTemplatesMongodbEphemeralTemplateJson, map[string]*bintree{}}, + "mongodb-persistent-template.json": &bintree{examplesDbTemplatesMongodbPersistentTemplateJson, map[string]*bintree{}}, + "mysql-ephemeral-template.json": &bintree{examplesDbTemplatesMysqlEphemeralTemplateJson, map[string]*bintree{}}, + "mysql-persistent-template.json": &bintree{examplesDbTemplatesMysqlPersistentTemplateJson, map[string]*bintree{}}, + "postgresql-ephemeral-template.json": &bintree{examplesDbTemplatesPostgresqlEphemeralTemplateJson, map[string]*bintree{}}, + "postgresql-persistent-template.json": &bintree{examplesDbTemplatesPostgresqlPersistentTemplateJson, map[string]*bintree{}}, + "redis-ephemeral-template.json": &bintree{examplesDbTemplatesRedisEphemeralTemplateJson, map[string]*bintree{}}, + "redis-persistent-template.json": &bintree{examplesDbTemplatesRedisPersistentTemplateJson, map[string]*bintree{}}, + }}, + "hello-openshift": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{examplesHelloOpenshiftDockerfile, map[string]*bintree{}}, + "hello-pod.json": &bintree{examplesHelloOpenshiftHelloPodJson, map[string]*bintree{}}, + "hello-project.json": &bintree{examplesHelloOpenshiftHelloProjectJson, map[string]*bintree{}}, + }}, + "image-streams": &bintree{nil, map[string]*bintree{ + "image-streams-centos7.json": &bintree{examplesImageStreamsImageStreamsCentos7Json, map[string]*bintree{}}, + "image-streams-rhel7.json": &bintree{examplesImageStreamsImageStreamsRhel7Json, map[string]*bintree{}}, + }}, + "jenkins": &bintree{nil, map[string]*bintree{ + "application-template.json": &bintree{examplesJenkinsApplicationTemplateJson, map[string]*bintree{}}, + "jenkins-ephemeral-template.json": &bintree{examplesJenkinsJenkinsEphemeralTemplateJson, map[string]*bintree{}}, + "jenkins-persistent-template.json": &bintree{examplesJenkinsJenkinsPersistentTemplateJson, map[string]*bintree{}}, + "pipeline": &bintree{nil, map[string]*bintree{ + "bluegreen-pipeline.yaml": &bintree{examplesJenkinsPipelineBluegreenPipelineYaml, map[string]*bintree{}}, + "mapsapp-pipeline.yaml": &bintree{examplesJenkinsPipelineMapsappPipelineYaml, map[string]*bintree{}}, + "maven-pipeline.yaml": &bintree{examplesJenkinsPipelineMavenPipelineYaml, map[string]*bintree{}}, + "openshift-client-plugin-pipeline.yaml": &bintree{examplesJenkinsPipelineOpenshiftClientPluginPipelineYaml, map[string]*bintree{}}, + "samplepipeline.yaml": &bintree{examplesJenkinsPipelineSamplepipelineYaml, map[string]*bintree{}}, + }}, + }}, + "sample-app": &bintree{nil, map[string]*bintree{ + "application-template-custombuild.json": &bintree{examplesSampleAppApplicationTemplateCustombuildJson, map[string]*bintree{}}, + "application-template-dockerbuild.json": &bintree{examplesSampleAppApplicationTemplateDockerbuildJson, map[string]*bintree{}}, + "application-template-pullspecbuild.json": &bintree{examplesSampleAppApplicationTemplatePullspecbuildJson, map[string]*bintree{}}, + "application-template-stibuild.json": &bintree{examplesSampleAppApplicationTemplateStibuildJson, map[string]*bintree{}}, + "cleanup.sh": &bintree{examplesSampleAppCleanupSh, map[string]*bintree{}}, + "github-webhook-example.json": &bintree{examplesSampleAppGithubWebhookExampleJson, map[string]*bintree{}}, + "pullimages.sh": &bintree{examplesSampleAppPullimagesSh, map[string]*bintree{}}, + }}, + }}, + "test": &bintree{nil, map[string]*bintree{ + "extended": &bintree{nil, map[string]*bintree{ + "testdata": &bintree{nil, map[string]*bintree{ + "build-extended": &bintree{nil, map[string]*bintree{ + "bc-scripts-by-url.yaml": &bintree{testExtendedTestdataBuildExtendedBcScriptsByUrlYaml, map[string]*bintree{}}, + "bc-scripts-in-repo.yaml": &bintree{testExtendedTestdataBuildExtendedBcScriptsInRepoYaml, map[string]*bintree{}}, + "bc-scripts-in-the-image.yaml": &bintree{testExtendedTestdataBuildExtendedBcScriptsInTheImageYaml, map[string]*bintree{}}, + "jvm-runner-with-scripts.yaml": &bintree{testExtendedTestdataBuildExtendedJvmRunnerWithScriptsYaml, map[string]*bintree{}}, + "jvm-runner.yaml": &bintree{testExtendedTestdataBuildExtendedJvmRunnerYaml, map[string]*bintree{}}, + }}, + "build-quota": &bintree{nil, map[string]*bintree{ + ".s2i": &bintree{nil, map[string]*bintree{ + "bin": &bintree{nil, map[string]*bintree{ + "assemble": &bintree{testExtendedTestdataBuildQuotaS2iBinAssemble, map[string]*bintree{}}, + }}, + }}, + "Dockerfile": &bintree{testExtendedTestdataBuildQuotaDockerfile, map[string]*bintree{}}, + }}, + "build-secrets": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataBuildSecretsDockerfile, map[string]*bintree{}}, + "s2i-binary-dir": &bintree{nil, map[string]*bintree{ + ".s2i": &bintree{nil, map[string]*bintree{ + "bin": &bintree{nil, map[string]*bintree{ + "assemble": &bintree{testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinAssemble, map[string]*bintree{}}, + "run": &bintree{testExtendedTestdataBuildSecretsS2iBinaryDirS2iBinRun, map[string]*bintree{}}, + }}, + }}, + "Gemfile": &bintree{testExtendedTestdataBuildSecretsS2iBinaryDirGemfile, map[string]*bintree{}}, + "config.ru": &bintree{testExtendedTestdataBuildSecretsS2iBinaryDirConfigRu, map[string]*bintree{}}, + }}, + "test-docker-build.json": &bintree{testExtendedTestdataBuildSecretsTestDockerBuildJson, map[string]*bintree{}}, + "test-is.json": &bintree{testExtendedTestdataBuildSecretsTestIsJson, map[string]*bintree{}}, + "test-s2i-build.json": &bintree{testExtendedTestdataBuildSecretsTestS2iBuildJson, map[string]*bintree{}}, + "test-secret-2.json": &bintree{testExtendedTestdataBuildSecretsTestSecret2Json, map[string]*bintree{}}, + "test-secret.json": &bintree{testExtendedTestdataBuildSecretsTestSecretJson, map[string]*bintree{}}, + }}, + "custom-secret-builder": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataCustomSecretBuilderDockerfile, map[string]*bintree{}}, + "build.sh": &bintree{testExtendedTestdataCustomSecretBuilderBuildSh, map[string]*bintree{}}, + }}, + "deployments": &bintree{nil, map[string]*bintree{ + "custom-deployment.yaml": &bintree{testExtendedTestdataDeploymentsCustomDeploymentYaml, map[string]*bintree{}}, + "deployment-example.yaml": &bintree{testExtendedTestdataDeploymentsDeploymentExampleYaml, map[string]*bintree{}}, + "deployment-history-limit.yaml": &bintree{testExtendedTestdataDeploymentsDeploymentHistoryLimitYaml, map[string]*bintree{}}, + "deployment-ignores-deployer.yaml": &bintree{testExtendedTestdataDeploymentsDeploymentIgnoresDeployerYaml, map[string]*bintree{}}, + "deployment-image-resolution.yaml": &bintree{testExtendedTestdataDeploymentsDeploymentImageResolutionYaml, map[string]*bintree{}}, + "deployment-min-ready-seconds.yaml": &bintree{testExtendedTestdataDeploymentsDeploymentMinReadySecondsYaml, map[string]*bintree{}}, + "deployment-simple.yaml": &bintree{testExtendedTestdataDeploymentsDeploymentSimpleYaml, map[string]*bintree{}}, + "deployment-with-ref-env.yaml": &bintree{testExtendedTestdataDeploymentsDeploymentWithRefEnvYaml, map[string]*bintree{}}, + "failing-pre-hook.yaml": &bintree{testExtendedTestdataDeploymentsFailingPreHookYaml, map[string]*bintree{}}, + "generation-test.yaml": &bintree{testExtendedTestdataDeploymentsGenerationTestYaml, map[string]*bintree{}}, + "multi-ict-deployment.yaml": &bintree{testExtendedTestdataDeploymentsMultiIctDeploymentYaml, map[string]*bintree{}}, + "paused-deployment.yaml": &bintree{testExtendedTestdataDeploymentsPausedDeploymentYaml, map[string]*bintree{}}, + "readiness-test.yaml": &bintree{testExtendedTestdataDeploymentsReadinessTestYaml, map[string]*bintree{}}, + "tag-images-deployment.yaml": &bintree{testExtendedTestdataDeploymentsTagImagesDeploymentYaml, map[string]*bintree{}}, + "test-deployment-broken.yaml": &bintree{testExtendedTestdataDeploymentsTestDeploymentBrokenYaml, map[string]*bintree{}}, + "test-deployment-test.yaml": &bintree{testExtendedTestdataDeploymentsTestDeploymentTestYaml, map[string]*bintree{}}, + }}, + "forcepull-test.json": &bintree{testExtendedTestdataForcepullTestJson, map[string]*bintree{}}, + "gssapi": &bintree{nil, map[string]*bintree{ + "config": &bintree{nil, map[string]*bintree{ + "kubeconfig": &bintree{testExtendedTestdataGssapiConfigKubeconfig, map[string]*bintree{}}, + "oauth_config.json": &bintree{testExtendedTestdataGssapiConfigOauth_configJson, map[string]*bintree{}}, + }}, + "fedora": &bintree{nil, map[string]*bintree{ + "base": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataGssapiFedoraBaseDockerfile, map[string]*bintree{}}, + }}, + "kerberos": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataGssapiFedoraKerberosDockerfile, map[string]*bintree{}}, + }}, + "kerberos_configured": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataGssapiFedoraKerberos_configuredDockerfile, map[string]*bintree{}}, + }}, + }}, + "proxy": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataGssapiProxyDockerfile, map[string]*bintree{}}, + "configure.sh": &bintree{testExtendedTestdataGssapiProxyConfigureSh, map[string]*bintree{}}, + "gssapiproxy-buildconfig.yaml": &bintree{testExtendedTestdataGssapiProxyGssapiproxyBuildconfigYaml, map[string]*bintree{}}, + "gssapiproxy-deploymentconfig.yaml": &bintree{testExtendedTestdataGssapiProxyGssapiproxyDeploymentconfigYaml, map[string]*bintree{}}, + "gssapiproxy-imagestream.yaml": &bintree{testExtendedTestdataGssapiProxyGssapiproxyImagestreamYaml, map[string]*bintree{}}, + "gssapiproxy-service.yaml": &bintree{testExtendedTestdataGssapiProxyGssapiproxyServiceYaml, map[string]*bintree{}}, + "healthz": &bintree{testExtendedTestdataGssapiProxyHealthz, map[string]*bintree{}}, + "kadm5.acl": &bintree{testExtendedTestdataGssapiProxyKadm5Acl, map[string]*bintree{}}, + "kdc.conf": &bintree{testExtendedTestdataGssapiProxyKdcConf, map[string]*bintree{}}, + "krb5.conf": &bintree{testExtendedTestdataGssapiProxyKrb5Conf, map[string]*bintree{}}, + "proxy.conf": &bintree{testExtendedTestdataGssapiProxyProxyConf, map[string]*bintree{}}, + }}, + "scripts": &bintree{nil, map[string]*bintree{ + "gssapi-tests.sh": &bintree{testExtendedTestdataGssapiScriptsGssapiTestsSh, map[string]*bintree{}}, + "test-wrapper.sh": &bintree{testExtendedTestdataGssapiScriptsTestWrapperSh, map[string]*bintree{}}, + }}, + "ubuntu": &bintree{nil, map[string]*bintree{ + "base": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataGssapiUbuntuBaseDockerfile, map[string]*bintree{}}, + }}, + "kerberos": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataGssapiUbuntuKerberosDockerfile, map[string]*bintree{}}, + }}, + "kerberos_configured": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataGssapiUbuntuKerberos_configuredDockerfile, map[string]*bintree{}}, + }}, + }}, + }}, + "hello-builder": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataHelloBuilderDockerfile, map[string]*bintree{}}, + "scripts": &bintree{nil, map[string]*bintree{ + "assemble": &bintree{testExtendedTestdataHelloBuilderScriptsAssemble, map[string]*bintree{}}, + "run": &bintree{testExtendedTestdataHelloBuilderScriptsRun, map[string]*bintree{}}, + }}, + }}, + "idling-echo-server-rc.yaml": &bintree{testExtendedTestdataIdlingEchoServerRcYaml, map[string]*bintree{}}, + "idling-echo-server.yaml": &bintree{testExtendedTestdataIdlingEchoServerYaml, map[string]*bintree{}}, + "image-pull-secrets": &bintree{nil, map[string]*bintree{ + "dc-with-new-pull-secret.yaml": &bintree{testExtendedTestdataImagePullSecretsDcWithNewPullSecretYaml, map[string]*bintree{}}, + "dc-with-old-pull-secret.yaml": &bintree{testExtendedTestdataImagePullSecretsDcWithOldPullSecretYaml, map[string]*bintree{}}, + "pod-with-new-pull-secret.yaml": &bintree{testExtendedTestdataImagePullSecretsPodWithNewPullSecretYaml, map[string]*bintree{}}, + "pod-with-no-pull-secret.yaml": &bintree{testExtendedTestdataImagePullSecretsPodWithNoPullSecretYaml, map[string]*bintree{}}, + "pod-with-old-pull-secret.yaml": &bintree{testExtendedTestdataImagePullSecretsPodWithOldPullSecretYaml, map[string]*bintree{}}, + }}, + "incremental-auth-build.json": &bintree{testExtendedTestdataIncrementalAuthBuildJson, map[string]*bintree{}}, + "jenkins-plugin": &bintree{nil, map[string]*bintree{ + "build-job-clone.xml": &bintree{testExtendedTestdataJenkinsPluginBuildJobCloneXml, map[string]*bintree{}}, + "build-job-slave.xml": &bintree{testExtendedTestdataJenkinsPluginBuildJobSlaveXml, map[string]*bintree{}}, + "build-job.xml": &bintree{testExtendedTestdataJenkinsPluginBuildJobXml, map[string]*bintree{}}, + "build-with-env-job.xml": &bintree{testExtendedTestdataJenkinsPluginBuildWithEnvJobXml, map[string]*bintree{}}, + "build-with-exec-steps.xml": &bintree{testExtendedTestdataJenkinsPluginBuildWithExecStepsXml, map[string]*bintree{}}, + "create-job.xml": &bintree{testExtendedTestdataJenkinsPluginCreateJobXml, map[string]*bintree{}}, + "delete-job-keys.xml": &bintree{testExtendedTestdataJenkinsPluginDeleteJobKeysXml, map[string]*bintree{}}, + "delete-job-labels.xml": &bintree{testExtendedTestdataJenkinsPluginDeleteJobLabelsXml, map[string]*bintree{}}, + "delete-job.xml": &bintree{testExtendedTestdataJenkinsPluginDeleteJobXml, map[string]*bintree{}}, + "imagestream-scm-dsl-job.xml": &bintree{testExtendedTestdataJenkinsPluginImagestreamScmDslJobXml, map[string]*bintree{}}, + "imagestream-scm-job.xml": &bintree{testExtendedTestdataJenkinsPluginImagestreamScmJobXml, map[string]*bintree{}}, + "multitag-job.xml": &bintree{testExtendedTestdataJenkinsPluginMultitagJobXml, map[string]*bintree{}}, + "multitag-template.json": &bintree{testExtendedTestdataJenkinsPluginMultitagTemplateJson, map[string]*bintree{}}, + "shared-resources-template.json": &bintree{testExtendedTestdataJenkinsPluginSharedResourcesTemplateJson, map[string]*bintree{}}, + }}, + "jobs": &bintree{nil, map[string]*bintree{ + "v1.yaml": &bintree{testExtendedTestdataJobsV1Yaml, map[string]*bintree{}}, + "v1beta1.yaml": &bintree{testExtendedTestdataJobsV1beta1Yaml, map[string]*bintree{}}, + }}, + "ldap": &bintree{nil, map[string]*bintree{ + "ldapserver-buildconfig.json": &bintree{testExtendedTestdataLdapLdapserverBuildconfigJson, map[string]*bintree{}}, + "ldapserver-deploymentconfig.json": &bintree{testExtendedTestdataLdapLdapserverDeploymentconfigJson, map[string]*bintree{}}, + "ldapserver-imagestream-testenv.json": &bintree{testExtendedTestdataLdapLdapserverImagestreamTestenvJson, map[string]*bintree{}}, + "ldapserver-imagestream.json": &bintree{testExtendedTestdataLdapLdapserverImagestreamJson, map[string]*bintree{}}, + "ldapserver-service.json": &bintree{testExtendedTestdataLdapLdapserverServiceJson, map[string]*bintree{}}, + }}, + "long_names": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataLong_namesDockerfile, map[string]*bintree{}}, + "fixture.json": &bintree{testExtendedTestdataLong_namesFixtureJson, map[string]*bintree{}}, + }}, + "roles": &bintree{nil, map[string]*bintree{ + "empty-role.yaml": &bintree{testExtendedTestdataRolesEmptyRoleYaml, map[string]*bintree{}}, + "policy-clusterroles.yaml": &bintree{testExtendedTestdataRolesPolicyClusterrolesYaml, map[string]*bintree{}}, + "policy-roles.yaml": &bintree{testExtendedTestdataRolesPolicyRolesYaml, map[string]*bintree{}}, + }}, + "run_policy": &bintree{nil, map[string]*bintree{ + "parallel-bc.yaml": &bintree{testExtendedTestdataRun_policyParallelBcYaml, map[string]*bintree{}}, + "serial-bc.yaml": &bintree{testExtendedTestdataRun_policySerialBcYaml, map[string]*bintree{}}, + "serial-latest-only-bc.yaml": &bintree{testExtendedTestdataRun_policySerialLatestOnlyBcYaml, map[string]*bintree{}}, + }}, + "s2i-dropcaps": &bintree{nil, map[string]*bintree{ + "root-access-build.yaml": &bintree{testExtendedTestdataS2iDropcapsRootAccessBuildYaml, map[string]*bintree{}}, + "rootable-ruby": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataS2iDropcapsRootableRubyDockerfile, map[string]*bintree{}}, + "adduser": &bintree{testExtendedTestdataS2iDropcapsRootableRubyAdduser, map[string]*bintree{}}, + "assemble": &bintree{testExtendedTestdataS2iDropcapsRootableRubyAssemble, map[string]*bintree{}}, + }}, + }}, + "sample-image-stream.json": &bintree{testExtendedTestdataSampleImageStreamJson, map[string]*bintree{}}, + "scoped-router.yaml": &bintree{testExtendedTestdataScopedRouterYaml, map[string]*bintree{}}, + "service-serving-cert": &bintree{nil, map[string]*bintree{ + "nginx-serving-cert.conf": &bintree{testExtendedTestdataServiceServingCertNginxServingCertConf, map[string]*bintree{}}, + }}, + "statusfail-assemble": &bintree{nil, map[string]*bintree{ + ".s2i": &bintree{nil, map[string]*bintree{ + "bin": &bintree{nil, map[string]*bintree{ + "assemble": &bintree{testExtendedTestdataStatusfailAssembleS2iBinAssemble, map[string]*bintree{}}, + }}, + }}, + }}, + "statusfail-failedassemble.yaml": &bintree{testExtendedTestdataStatusfailFailedassembleYaml, map[string]*bintree{}}, + "statusfail-fetchbuilderimage.yaml": &bintree{testExtendedTestdataStatusfailFetchbuilderimageYaml, map[string]*bintree{}}, + "statusfail-fetchsourcedocker.yaml": &bintree{testExtendedTestdataStatusfailFetchsourcedockerYaml, map[string]*bintree{}}, + "statusfail-fetchsources2i.yaml": &bintree{testExtendedTestdataStatusfailFetchsources2iYaml, map[string]*bintree{}}, + "statusfail-postcommithook.yaml": &bintree{testExtendedTestdataStatusfailPostcommithookYaml, map[string]*bintree{}}, + "statusfail-pushtoregistry.yaml": &bintree{testExtendedTestdataStatusfailPushtoregistryYaml, map[string]*bintree{}}, + "statusfail-runtimeartifacts.yaml": &bintree{testExtendedTestdataStatusfailRuntimeartifactsYaml, map[string]*bintree{}}, + "sti-environment-build-app": &bintree{nil, map[string]*bintree{ + ".sti": &bintree{nil, map[string]*bintree{ + "environment": &bintree{testExtendedTestdataStiEnvironmentBuildAppStiEnvironment, map[string]*bintree{}}, + }}, + "Gemfile": &bintree{testExtendedTestdataStiEnvironmentBuildAppGemfile, map[string]*bintree{}}, + "config.ru": &bintree{testExtendedTestdataStiEnvironmentBuildAppConfigRu, map[string]*bintree{}}, + }}, + "test-auth-build.yaml": &bintree{testExtendedTestdataTestAuthBuildYaml, map[string]*bintree{}}, + "test-build-app": &bintree{nil, map[string]*bintree{ + "Dockerfile": &bintree{testExtendedTestdataTestBuildAppDockerfile, map[string]*bintree{}}, + "Gemfile": &bintree{testExtendedTestdataTestBuildAppGemfile, map[string]*bintree{}}, + "config.ru": &bintree{testExtendedTestdataTestBuildAppConfigRu, map[string]*bintree{}}, + }}, + "test-build-podsvc.json": &bintree{testExtendedTestdataTestBuildPodsvcJson, map[string]*bintree{}}, + "test-build-postcommit.json": &bintree{testExtendedTestdataTestBuildPostcommitJson, map[string]*bintree{}}, + "test-build-proxy.json": &bintree{testExtendedTestdataTestBuildProxyJson, map[string]*bintree{}}, + "test-build-revision.json": &bintree{testExtendedTestdataTestBuildRevisionJson, map[string]*bintree{}}, + "test-build.json": &bintree{testExtendedTestdataTestBuildJson, map[string]*bintree{}}, + "test-buildconfigsecretinjector.yaml": &bintree{testExtendedTestdataTestBuildconfigsecretinjectorYaml, map[string]*bintree{}}, + "test-cds-dockerbuild.json": &bintree{testExtendedTestdataTestCdsDockerbuildJson, map[string]*bintree{}}, + "test-cds-sourcebuild.json": &bintree{testExtendedTestdataTestCdsSourcebuildJson, map[string]*bintree{}}, + "test-cli-debug.yaml": &bintree{testExtendedTestdataTestCliDebugYaml, map[string]*bintree{}}, + "test-context-build.json": &bintree{testExtendedTestdataTestContextBuildJson, map[string]*bintree{}}, + "test-custom-build.json": &bintree{testExtendedTestdataTestCustomBuildJson, map[string]*bintree{}}, + "test-docker-build-pullsecret.json": &bintree{testExtendedTestdataTestDockerBuildPullsecretJson, map[string]*bintree{}}, + "test-docker-build-quota.json": &bintree{testExtendedTestdataTestDockerBuildQuotaJson, map[string]*bintree{}}, + "test-docker-build.json": &bintree{testExtendedTestdataTestDockerBuildJson, map[string]*bintree{}}, + "test-docker-no-outputname.json": &bintree{testExtendedTestdataTestDockerNoOutputnameJson, map[string]*bintree{}}, + "test-env-build.json": &bintree{testExtendedTestdataTestEnvBuildJson, map[string]*bintree{}}, + "test-env-pod.json": &bintree{testExtendedTestdataTestEnvPodJson, map[string]*bintree{}}, + "test-gitserver-tokenauth.yaml": &bintree{testExtendedTestdataTestGitserverTokenauthYaml, map[string]*bintree{}}, + "test-gitserver.yaml": &bintree{testExtendedTestdataTestGitserverYaml, map[string]*bintree{}}, + "test-imagesource-build.yaml": &bintree{testExtendedTestdataTestImagesourceBuildYaml, map[string]*bintree{}}, + "test-nosrc-build.json": &bintree{testExtendedTestdataTestNosrcBuildJson, map[string]*bintree{}}, + "test-s2i-build-quota.json": &bintree{testExtendedTestdataTestS2iBuildQuotaJson, map[string]*bintree{}}, + "test-s2i-build.json": &bintree{testExtendedTestdataTestS2iBuildJson, map[string]*bintree{}}, + "test-s2i-no-outputname.json": &bintree{testExtendedTestdataTestS2iNoOutputnameJson, map[string]*bintree{}}, + "test-secret-build.json": &bintree{testExtendedTestdataTestSecretBuildJson, map[string]*bintree{}}, + "test-secret.json": &bintree{testExtendedTestdataTestSecretJson, map[string]*bintree{}}, + "weighted-router.yaml": &bintree{testExtendedTestdataWeightedRouterYaml, map[string]*bintree{}}, + }}, + }}, + "integration": &bintree{nil, map[string]*bintree{ + "testdata": &bintree{nil, map[string]*bintree{ + "project-request-template-with-quota.yaml": &bintree{testIntegrationTestdataProjectRequestTemplateWithQuotaYaml, map[string]*bintree{}}, + "test-buildcli-beta2.json": &bintree{testIntegrationTestdataTestBuildcliBeta2Json, map[string]*bintree{}}, + "test-buildcli.json": &bintree{testIntegrationTestdataTestBuildcliJson, map[string]*bintree{}}, + "test-deployment-config.yaml": &bintree{testIntegrationTestdataTestDeploymentConfigYaml, map[string]*bintree{}}, + "test-egress-network-policy.json": &bintree{testIntegrationTestdataTestEgressNetworkPolicyJson, map[string]*bintree{}}, + "test-image-stream-mapping.json": &bintree{testIntegrationTestdataTestImageStreamMappingJson, map[string]*bintree{}}, + "test-image-stream.json": &bintree{testIntegrationTestdataTestImageStreamJson, map[string]*bintree{}}, + "test-image.json": &bintree{testIntegrationTestdataTestImageJson, map[string]*bintree{}}, + "test-route.json": &bintree{testIntegrationTestdataTestRouteJson, map[string]*bintree{}}, + "test-service-with-finalizer.json": &bintree{testIntegrationTestdataTestServiceWithFinalizerJson, map[string]*bintree{}}, + "test-service.json": &bintree{testIntegrationTestdataTestServiceJson, map[string]*bintree{}}, + }}, + }}, + }}, +}} + +// RestoreAsset restores an asset under the given directory +func RestoreAsset(dir, name string) error { + data, err := Asset(name) + if err != nil { + return err + } + info, err := AssetInfo(name) + if err != nil { + return err + } + err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) + if err != nil { + return err + } + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + if err != nil { + return err + } + err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) + if err != nil { + return err + } + return nil +} + +// RestoreAssets restores an asset under the given directory recursively +func RestoreAssets(dir, name string) error { + children, err := AssetDir(name) + // File + if err != nil { + return RestoreAsset(dir, name) + } + // Dir + for _, child := range children { + err = RestoreAssets(dir, filepath.Join(name, child)) + if err != nil { + return err + } + } + return nil +} + +func _filePath(dir, name string) string { + cannonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) +} + diff --git a/test/extended/util/framework.go b/test/extended/util/framework.go index 6543dd0932f5..5fb528fb655e 100644 --- a/test/extended/util/framework.go +++ b/test/extended/util/framework.go @@ -7,10 +7,12 @@ import ( "net/http" "os" "os/exec" + "path" "path/filepath" "regexp" "strconv" "strings" + "sync" "time" g "github.com/onsi/ginkgo" @@ -40,6 +42,7 @@ import ( deployutil "github.com/openshift/origin/pkg/deploy/util" imageapi "github.com/openshift/origin/pkg/image/api" "github.com/openshift/origin/pkg/util/namer" + "github.com/openshift/origin/test/extended/testdata" ) const pvPrefix = "pv-" @@ -1108,7 +1111,7 @@ func SetupHostPathVolumes(c kcoreclient.PersistentVolumeInterface, prefix, capac if err != nil { return volumes, err } - if _, err = exec.LookPath("chcon"); err != nil { + if _, err = exec.LookPath("chcon"); err == nil { err := exec.Command("chcon", "-t", "svirt_sandbox_file_t", dir).Run() if err != nil { return volumes, err @@ -1175,12 +1178,6 @@ func KubeConfigPath() string { return os.Getenv("KUBECONFIG") } -// ExtendedTestPath returns absolute path to extended tests directory -func ExtendedTestPath() string { - // can't use gomega in this method since it is used outside of It() - return os.Getenv("EXTENDED_TEST_PATH") -} - //ArtifactDirPath returns the value of ARTIFACT_DIR environment variable func ArtifactDirPath() string { path := os.Getenv("ARTIFACT_DIR") @@ -1195,10 +1192,61 @@ func ArtifactPath(elem ...string) string { return filepath.Join(append([]string{ArtifactDirPath()}, elem...)...) } -// FixturePath returns absolute path to given fixture file -// The path is relative to EXTENDED_TEST_PATH (./test/extended/*) +var ( + fixtureDirLock sync.Once + fixtureDir string +) + +// FixturePath returns an absolute path to a fixture file in test/extended/testdata/, +// test/integration/, or examples/. func FixturePath(elem ...string) string { - return filepath.Join(append([]string{ExtendedTestPath()}, elem...)...) + switch { + case len(elem) == 0: + panic("must specify path") + case len(elem) > 3 && elem[0] == ".." && elem[1] == ".." && elem[2] == "examples": + elem = elem[2:] + case len(elem) > 3 && elem[0] == ".." && elem[1] == "integration": + elem = append([]string{"test"}, elem[1:]...) + case elem[0] == "testdata": + elem = append([]string{"test", "extended"}, elem...) + default: + panic(fmt.Sprintf("Fixtures must be in test/extended/testdata or examples not %s", path.Join(elem...))) + } + fixtureDirLock.Do(func() { + dir, err := ioutil.TempDir("", "fixture-testdata-dir") + if err != nil { + panic(err) + } + fixtureDir = dir + }) + relativePath := path.Join(elem...) + fullPath := path.Join(fixtureDir, relativePath) + if err := testdata.RestoreAsset(fixtureDir, relativePath); err != nil { + if err := testdata.RestoreAssets(fixtureDir, relativePath); err != nil { + panic(err) + } + if err := filepath.Walk(fullPath, func(path string, info os.FileInfo, err error) error { + if err := os.Chmod(path, 0640); err != nil { + return err + } + if stat, err := os.Lstat(path); err == nil && stat.IsDir() { + return os.Chmod(path, 0755) + } + return nil + }); err != nil { + panic(err) + } + } else { + if err := os.Chmod(fullPath, 0640); err != nil { + panic(err) + } + } + + p, err := filepath.Abs(fullPath) + if err != nil { + panic(err) + } + return p } // FetchURL grabs the output from the specified url and returns it.