Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/sample-app/application-template-dockerbuild.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "ruby-22-centos7"
"name": "ruby-25-centos7"
},
"spec": {
"dockerImageRepository": "centos/ruby-22-centos7"
"dockerImageRepository": "centos/ruby-25-centos7"
},
"status": {
"dockerImageRepository": ""
Expand Down Expand Up @@ -138,7 +138,7 @@
"dockerStrategy": {
"from": {
"kind": "ImageStreamTag",
"name": "ruby-22-centos7:latest"
"name": "ruby-25-centos7:latest"
},
"env": [
{
Expand Down
6 changes: 3 additions & 3 deletions examples/sample-app/application-template-stibuild.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "ruby-22-centos7"
"name": "ruby-25-centos7"
},
"spec": {
"dockerImageRepository": "centos/ruby-22-centos7"
"dockerImageRepository": "centos/ruby-25-centos7"
},
"status": {
"dockerImageRepository": ""
Expand Down Expand Up @@ -138,7 +138,7 @@
"sourceStrategy": {
"from": {
"kind": "ImageStreamTag",
"name": "ruby-22-centos7:latest"
"name": "ruby-25-centos7:latest"
},
"env": [
{
Expand Down
34 changes: 17 additions & 17 deletions pkg/oc/lib/describe/chaindescriber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ func TestChainDescriber(t *testing.T) {
namespaces: sets.NewString("example"),
output: "",
defaultNamespace: "example",
name: "ruby-22-centos7",
name: "ruby-25-centos7",
tag: "latest",
path: "../graph/genericgraph/test/circular.yaml",
humanReadable: map[string]int{
"Cycle detected in build configurations: bc/ruby-22-centos7 -> istag/ruby-hello-world:latest -> bc/ruby-hello-world -> istag/ruby-something-else:latest -> bc/ruby-something-else -> istag/ruby-22-centos7:latest -> bc/ruby-22-centos7": 1,
"Cycle detected in build configurations: bc/ruby-25-centos7 -> istag/ruby-hello-world:latest -> bc/ruby-hello-world -> istag/ruby-something-else:latest -> bc/ruby-something-else -> istag/ruby-25-centos7:latest -> bc/ruby-25-centos7": 1,
},
expectedErr: nil,
},
Expand All @@ -50,11 +50,11 @@ func TestChainDescriber(t *testing.T) {
namespaces: sets.NewString("test"),
output: "",
defaultNamespace: "test",
name: "ruby-22-centos7",
name: "ruby-25-centos7",
tag: "latest",
path: "../../../../pkg/oc/cli/admin/buildchain/test/single-namespace-bcs.yaml",
humanReadable: map[string]int{
"istag/ruby-22-centos7:latest": 1,
"istag/ruby-25-centos7:latest": 1,
"\tbc/ruby-hello-world": 1,
"\t\tistag/ruby-hello-world:latest": 1,
"\tbc/ruby-sample-build": 1,
Expand All @@ -67,16 +67,16 @@ func TestChainDescriber(t *testing.T) {
namespaces: sets.NewString("test"),
output: "dot",
defaultNamespace: "test",
name: "ruby-22-centos7",
name: "ruby-25-centos7",
tag: "latest",
path: "../../../../pkg/oc/cli/admin/buildchain/test/single-namespace-bcs.yaml",
dot: []string{
"digraph \"ruby-22-centos7:latest\" {",
"digraph \"ruby-25-centos7:latest\" {",
"// Node definitions.",
"[label=\"BuildConfig|test/ruby-hello-world\"];",
"[label=\"BuildConfig|test/ruby-sample-build\"];",
"[label=\"ImageStreamTag|test/ruby-hello-world:latest\"];",
"[label=\"ImageStreamTag|test/ruby-22-centos7:latest\"];",
"[label=\"ImageStreamTag|test/ruby-25-centos7:latest\"];",
"[label=\"ImageStreamTag|test/origin-ruby-sample:latest\"];",
"",
"// Edge definitions.",
Expand All @@ -93,11 +93,11 @@ func TestChainDescriber(t *testing.T) {
namespaces: sets.NewString("test", "master", "default"),
output: "",
defaultNamespace: "master",
name: "ruby-22-centos7",
name: "ruby-25-centos7",
tag: "latest",
path: "../../../../pkg/oc/cli/admin/buildchain/test/multiple-namespaces-bcs.yaml",
humanReadable: map[string]int{
"<master istag/ruby-22-centos7:latest>": 1,
"<master istag/ruby-25-centos7:latest>": 1,
"\t<default bc/ruby-hello-world>": 1,
"\t\t<test istag/ruby-hello-world:latest>": 1,
"\t<test bc/ruby-sample-build>": 1,
Expand All @@ -110,16 +110,16 @@ func TestChainDescriber(t *testing.T) {
namespaces: sets.NewString("test", "master", "default"),
output: "dot",
defaultNamespace: "master",
name: "ruby-22-centos7",
name: "ruby-25-centos7",
tag: "latest",
path: "../../../../pkg/oc/cli/admin/buildchain/test/multiple-namespaces-bcs.yaml",
dot: []string{
"digraph \"ruby-22-centos7:latest\" {",
"digraph \"ruby-25-centos7:latest\" {",
"// Node definitions.",
"[label=\"BuildConfig|default/ruby-hello-world\"];",
"[label=\"BuildConfig|test/ruby-sample-build\"];",
"[label=\"ImageStreamTag|test/ruby-hello-world:latest\"];",
"[label=\"ImageStreamTag|master/ruby-22-centos7:latest\"];",
"[label=\"ImageStreamTag|master/ruby-25-centos7:latest\"];",
"[label=\"ImageStreamTag|another/origin-ruby-sample:latest\"];",
"",
"// Edge definitions.",
Expand All @@ -133,13 +133,13 @@ func TestChainDescriber(t *testing.T) {
},
{
testName: "human readable - multiple triggers - triggeronly",
name: "ruby-22-centos7",
name: "ruby-25-centos7",
defaultNamespace: "test",
tag: "latest",
path: "../../../../pkg/oc/cli/admin/buildchain/test/multiple-trigger-bcs.yaml",
namespaces: sets.NewString("test"),
humanReadable: map[string]int{
"istag/ruby-22-centos7:latest": 1,
"istag/ruby-25-centos7:latest": 1,
"\tbc/parent1": 1,
"\t\tistag/parent1img:latest": 1,
"\t\t\tbc/child2": 2,
Expand All @@ -156,14 +156,14 @@ func TestChainDescriber(t *testing.T) {
},
{
testName: "human readable - multiple triggers - trigger+input",
name: "ruby-22-centos7",
name: "ruby-25-centos7",
defaultNamespace: "test",
tag: "latest",
path: "../../../../pkg/oc/cli/admin/buildchain/test/multiple-trigger-bcs.yaml",
namespaces: sets.NewString("test"),
includeInputImg: true,
humanReadable: map[string]int{
"istag/ruby-22-centos7:latest": 1,
"istag/ruby-25-centos7:latest": 1,
"\tbc/parent1": 1,
"\t\tistag/parent1img:latest": 1,
"\t\t\tbc/child1": 2,
Expand Down Expand Up @@ -191,7 +191,7 @@ func TestChainDescriber(t *testing.T) {
"\tbc/child2": 1,
"\t\tistag/parent1img:latest": 1,
"\t\t\tbc/parent1": 1,
"\t\t\t\tistag/ruby-22-centos7:latest": 2,
"\t\t\t\tistag/ruby-25-centos7:latest": 2,
"\t\tistag/parent3img:latest": 1,
"\t\t\tbc/parent3": 1,
},
Expand Down
2 changes: 1 addition & 1 deletion test/cmd/admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ os::cmd::expect_success 'oc process -f examples/sample-app/application-template-
# Test both the type/name resource syntax and the fact that istag/origin-ruby-sample:latest is still
# not created but due to a buildConfig pointing to it, we get back its graph of deps.
os::cmd::expect_success_and_text 'oc adm build-chain istag/origin-ruby-sample' 'istag/origin-ruby-sample:latest'
os::cmd::expect_success_and_text 'oc adm build-chain ruby-22-centos7 -o dot' 'digraph "ruby-22-centos7:latest"'
os::cmd::expect_success_and_text 'oc adm build-chain ruby-25-centos7 -o dot' 'digraph "ruby-25-centos7:latest"'
os::cmd::expect_success 'oc delete all -l build=sti'
echo "ex build-chain: ok"
os::test::junit::declare_suite_end
Expand Down
12 changes: 6 additions & 6 deletions test/cmd/builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ project="$(oc project -q)"
os::test::junit::declare_suite_start "cmd/builds"
# This test validates builds and build related commands

os::cmd::expect_success 'oc new-build centos/ruby-22-centos7 https://github.com/openshift/ruby-hello-world.git'
os::cmd::expect_success 'oc new-build centos/ruby-25-centos7 https://github.com/openshift/ruby-hello-world.git'
os::cmd::expect_success 'oc get bc/ruby-hello-world'

os::cmd::expect_success "cat '${OS_ROOT}/images/cli/Dockerfile' | oc new-build -D - --name=test"
Expand Down Expand Up @@ -59,8 +59,8 @@ os::cmd::expect_success 'oc delete is/origin'
os::cmd::expect_success "oc new-build -D \$'FROM openshift/origin:v1.1\nENV ok=1' --to origin-name-test --name origin-test2"
os::cmd::expect_success_and_text "oc get bc/origin-test2 --template '${template}'" '^ImageStreamTag origin-name-test:latest$'

os::cmd::try_until_text 'oc get is ruby-22-centos7' 'latest'
os::cmd::expect_failure_and_text 'oc new-build ruby-22-centos7~https://github.com/sclorg/ruby-ex ruby-22-centos7~https://github.com/sclorg/ruby-ex --to invalid/argument' 'error: only one component with source can be used when specifying an output image reference'
os::cmd::try_until_text 'oc get is ruby-25-centos7' 'latest'
os::cmd::expect_failure_and_text 'oc new-build ruby-25-centos7~https://github.com/openshift/ruby-ex ruby-25-centos7~https://github.com/openshift/ruby-ex --to invalid/argument' 'error: only one component with source can be used when specifying an output image reference'

os::cmd::expect_success 'oc delete all --all'

Expand All @@ -77,7 +77,7 @@ os::cmd::expect_success 'oc get bc'
os::cmd::expect_success 'oc get builds'

# make sure the imagestream has the latest tag before trying to test it or start a build with it
os::cmd::try_until_text 'oc get is ruby-22-centos7' 'latest'
os::cmd::try_until_text 'oc get is ruby-25-centos7' 'latest'

os::test::junit::declare_suite_start "cmd/builds/patch-anon-fields"
REAL_OUTPUT_TO=$(oc get bc/ruby-sample-build --template='{{ .spec.output.to.name }}')
Expand Down Expand Up @@ -120,9 +120,9 @@ os::cmd::expect_success 'oc create -f test/integration/testdata/test-buildcli.js
# the build should use the image field as defined in the buildconfig
# Use basename to transform "build/build-name" into "build-name"
started="$(basename $(oc start-build -o=name ruby-sample-build-invalidtag))"
os::cmd::expect_success_and_text "oc describe build ${started}" 'centos/ruby-22-centos7$'
os::cmd::expect_success_and_text "oc describe build ${started}" 'centos/ruby-25-centos7$'
frombuild="$(basename $(oc start-build -o=name --from-build="${started}"))"
os::cmd::expect_success_and_text "oc describe build ${frombuild}" 'centos/ruby-22-centos7$'
os::cmd::expect_success_and_text "oc describe build ${frombuild}" 'centos/ruby-25-centos7$'
os::cmd::expect_failure_and_text "oc start-build ruby-sample-build-invalid-tag --from-dir=. --from-build=${started}" "Cannot use '--from-build' flag with binary builds"
os::cmd::expect_failure_and_text "oc start-build ruby-sample-build-invalid-tag --from-file=. --from-build=${started}" "Cannot use '--from-build' flag with binary builds"
os::cmd::expect_failure_and_text "oc start-build ruby-sample-build-invalid-tag --from-repo=. --from-build=${started}" "Cannot use '--from-build' flag with binary builds"
Expand Down
8 changes: 4 additions & 4 deletions test/cmd/newapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ os::cmd::expect_success 'oc new-app --docker-image=library/perl https://github.c
os::cmd::try_until_success 'oc get istag perl:latest -n test-imagestreams'

# remove redundant imagestream tag before creating objects
os::cmd::expect_success_and_text 'oc new-app openshift/ruby-22-centos7 https://github.com/openshift/ruby-hello-world --strategy=docker --loglevel=5' 'Removing duplicate tag from object list'
os::cmd::expect_success_and_text 'oc new-app openshift/ruby-25-centos7 https://github.com/openshift/ruby-hello-world --strategy=docker --loglevel=5' 'Removing duplicate tag from object list'

# create imagestream in the correct namespace
os::cmd::expect_success 'oc new-app --name=mytest --image-stream=mysql --env=MYSQL_USER=test --env=MYSQL_PASSWORD=redhat --env=MYSQL_DATABASE=testdb -l app=mytest'
Expand Down Expand Up @@ -507,7 +507,7 @@ os::cmd::expect_success_and_text 'oc new-build mysql https://github.com/openshif
os::cmd::expect_failure_and_text 'oc new-build mysql https://github.com/openshift/ruby-hello-world --binary' 'specifying binary builds and source repositories at the same time is not allowed'
# binary builds cannot be created unless a builder image is specified.
os::cmd::expect_failure_and_text 'oc new-build --name mybuild --binary --strategy=source -o yaml' 'you must provide a builder image when using the source strategy with a binary build'
os::cmd::expect_success_and_text 'oc new-build --name mybuild centos/ruby-22-centos7 --binary --strategy=source -o yaml' 'name: ruby-22-centos7:latest'
os::cmd::expect_success_and_text 'oc new-build --name mybuild centos/ruby-25-centos7 --binary --strategy=source -o yaml' 'name: ruby-25-centos7:latest'
# binary builds can be created with no builder image if no strategy or docker strategy is specified
os::cmd::expect_success_and_text 'oc new-build --name mybuild --binary -o yaml' 'type: Binary'
os::cmd::expect_success_and_text 'oc new-build --name mybuild --binary --strategy=docker -o yaml' 'type: Binary'
Expand Down Expand Up @@ -591,7 +591,7 @@ os::cmd::expect_success 'oc new-app -i ruby-20-centos7:latest --code https://git
os::cmd::expect_success 'oc new-app -i ruby-20-centos7:latest --code ./test/testdata/testapp --dry-run'

os::cmd::expect_success 'oc new-app --code ./test/testdata/testapp --name test'
os::cmd::expect_success_and_text 'oc get bc test --template={{.spec.strategy.dockerStrategy.from.name}}' 'ruby-22-centos7:latest'
os::cmd::expect_success_and_text 'oc get bc test --template={{.spec.strategy.dockerStrategy.from.name}}' 'ruby-25-centos7:latest'

os::cmd::expect_success 'oc new-app -i php-55-centos7:latest --code ./test/testdata/testapp --name test2'
os::cmd::expect_success_and_text 'oc get bc test2 --template={{.spec.strategy.sourceStrategy.from.name}}' 'php-55-centos7:latest'
Expand All @@ -609,7 +609,7 @@ os::cmd::expect_success 'oc new-app php-55-centos7:latest --code https://github.
os::cmd::expect_success_and_text 'oc get bc test6 --template={{.spec.strategy.sourceStrategy.from.name}}' 'php-55-centos7:latest'

os::cmd::expect_success 'oc new-app https://github.com/openshift/ruby-hello-world.git --name test7'
os::cmd::expect_success_and_text 'oc get bc test7 --template={{.spec.strategy.dockerStrategy.from.name}}' 'ruby-22-centos7:latest'
os::cmd::expect_success_and_text 'oc get bc test7 --template={{.spec.strategy.dockerStrategy.from.name}}' 'ruby-25-centos7:latest'

os::cmd::expect_success 'oc new-app php-55-centos7:latest https://github.com/openshift/ruby-hello-world.git --name test8'
os::cmd::expect_success_and_text 'oc get bc test8 --template={{.spec.strategy.sourceStrategy.from.name}}' 'php-55-centos7:latest'
Expand Down
8 changes: 4 additions & 4 deletions test/cmd/templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ os::cmd::expect_success 'oc process ruby-helloworld-sample -o go-template-file=/
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o jsonpath --template "{.kind}"' "List"
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o jsonpath={.kind}' "List"
os::cmd::expect_success 'oc process ruby-helloworld-sample -o jsonpath-file=/dev/null'
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o describe' "ruby-22-centos7"
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o json' "ruby-22-centos7"
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o yaml' "ruby-22-centos7"
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o name' "ruby-22-centos7"
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o describe' "ruby-25-centos7"
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o json' "ruby-25-centos7"
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o yaml' "ruby-25-centos7"
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o name' "ruby-25-centos7"
os::cmd::expect_success_and_text 'oc describe templates ruby-helloworld-sample' "BuildConfig.*ruby-sample-build"
os::cmd::expect_success 'oc delete templates ruby-helloworld-sample'
os::cmd::expect_success 'oc get templates'
Expand Down
Loading