Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace oc run for dc/jobs and others with oc create equivalents #24765

Merged
merged 1 commit into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 9 additions & 13 deletions test/extended/testdata/bindata.go

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

16 changes: 6 additions & 10 deletions test/extended/testdata/cmd/test/cmd/basicresources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,19 +278,15 @@ export KUBECONFIG="${temp_config}"
#os::cmd::expect_success 'oc new-project test-project-admin'
#os::cmd::try_until_success "oc project test-project-admin"

os::cmd::expect_success 'oc run --image=openshift/hello-openshift test'
os::cmd::expect_success 'oc run --image=openshift/hello-openshift --generator=run-controller/v1 test2'
os::cmd::expect_success 'oc create deploymentconfig --image=openshift/hello-openshift test'
os::cmd::expect_success 'oc run --image=openshift/hello-openshift --restart=Never test3'
os::cmd::expect_success 'oc run --image=openshift/hello-openshift --generator=job/v1 --restart=Never test4'
os::cmd::expect_success 'oc delete dc/test rc/test2 pod/test3 job/test4'
os::cmd::expect_success 'oc create job --image=openshift/hello-openshift test4'
os::cmd::expect_success 'oc delete dc/test pod/test3 job/test4'

os::cmd::expect_success_and_text 'oc run --dry-run foo --image=bar -o name' 'deploymentconfig.apps.openshift.io/foo'
os::cmd::expect_success_and_text 'oc run --dry-run foo --image=bar -o name --restart=Always' 'deploymentconfig.apps.openshift.io/foo'
os::cmd::expect_success_and_text 'oc create deploymentconfig --dry-run foo --image=bar -o name' 'deploymentconfig.apps.openshift.io/foo'
os::cmd::expect_success_and_text 'oc run --dry-run foo --image=bar -o name --restart=Never' 'pod/foo'
os::cmd::expect_success_and_text 'oc run --dry-run foo --image=bar -o name --generator=job/v1' 'job.batch/foo'
os::cmd::expect_success_and_text 'oc run --dry-run foo --image=bar -o name --generator=deploymentconfig/v1' 'deploymentconfig.apps.openshift.io/foo'
os::cmd::expect_success_and_text 'oc run --dry-run foo --image=bar -o name --generator=run-controller/v1' 'replicationcontroller/foo'
os::cmd::expect_success_and_text 'oc run --dry-run foo --image=bar -o name --generator=run/v1' 'replicationcontroller/foo'
os::cmd::expect_success_and_text 'oc create job --dry-run foo --image=bar -o name' 'job.batch/foo'
os::cmd::expect_success_and_text 'oc create deploymentconfig --dry-run foo --image=bar -o name' 'deploymentconfig.apps.openshift.io/foo'
os::cmd::expect_success_and_text 'oc run --dry-run foo --image=bar -o name --generator=run-pod/v1' 'pod/foo'

os::cmd::expect_success 'oc process -f ${TEST_DATA}/application-template-stibuild.json -l name=mytemplate | oc create -f -'
Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/cmd/test/cmd/image-lookup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ os::cmd::expect_success_and_text "oc set image-lookup is/nginx" "updated"
os::cmd::expect_success "oc run --generator=run-pod/v1 --restart=Never --image=nginx:latest nginx"
os::cmd::expect_success_and_text "oc get pod/nginx -o jsonpath='{.spec.containers[0].image}'" "nginx@sha256:"
## Image lookup works for jobs
os::cmd::expect_success "oc run --generator=job/v1 --restart=Never --image=nginx:latest nginx"
os::cmd::expect_success "oc create job --image=nginx:latest nginx"
os::cmd::expect_success_and_text "oc get job/nginx -o jsonpath='{.spec.template.spec.containers[0].image}'" "nginx@sha256:"
## Image lookup works for replica sets
os::cmd::expect_success "oc create deployment --image=nginx:latest nginx"
Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/cmd/test/cmd/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ trap os::test::junit::reconcile_output EXIT

os::test::junit::declare_suite_start "cmd/run"
# This test validates the value of --image for oc run
os::cmd::expect_success_and_text 'oc run newdcforimage --image=validimagevalue' 'deploymentconfig.apps.openshift.io/newdcforimage created'
os::cmd::expect_success_and_text 'oc create deploymentconfig newdcforimage --image=validimagevalue' 'deploymentconfig.apps.openshift.io/newdcforimage created'
os::cmd::expect_failure_and_text 'oc run newdcforimage2 --image="InvalidImageValue0192"' 'error: Invalid image name "InvalidImageValue0192": invalid reference format'
os::cmd::expect_failure_and_text 'oc run test1 --image=busybox --attach --dry-run' "dry-run can't be used with attached containers options"
os::cmd::expect_failure_and_text 'oc run test1 --image=busybox --stdin --dry-run' "dry-run can't be used with attached containers options"
Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/cmd/test/cmd/status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ os::cmd::expect_success_and_text 'oc status -v' 'shorthand -v has been deprecate
os::cmd::expect_success_and_text 'oc status --verbose' '\-\-verbose has been deprecated'

# Verify jobs are showing in status
os::cmd::expect_success "oc run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'"
os::cmd::expect_success "oc create job pi --image=perl -- perl -Mbignum=bpi -wle 'print bpi(2000)'"
os::cmd::expect_success_and_text "oc status" "job/pi manages perl"

# logout
Expand Down