@@ -339,7 +339,7 @@ function ct_os_delete_project() {
339339# Deletes all objects within the project.
340340# Handy when we have one project and want to run more tests.
341341function ct_delete_all_objects() {
342- for x in bc builds dc is isimage istag po pv pvc rc routes secrets svc ; do
342+ for x in bc builds dc deployment replicaset is isimage istag po pv pvc rc routes secrets svc ; do
343343 oc delete " $x " --all
344344 done
345345 # for some objects it takes longer to be really deleted, so a dummy sleep
@@ -1254,11 +1254,14 @@ function ct_os_service_image_info() {
12541254 local namespace
12551255
12561256 # get image ID from the deployment config
1257- image_id=$( oc get " deploymentconfig.apps.openshift.io/${service_name} " -o custom-columns=IMAGE:.spec.template.spec.containers[* ].image | tail -n 1)
1257+ # In recent OCP 4.x versions, a Deployment that configures a ReplicaSet is
1258+ # now the recommended way to set up replication, instead of DeploymentConfig
1259+ # configuring ReplicationController. So, trying both one after another.
1260+ image_id=$( (oc get " deploymentconfig.apps.openshift.io/${service_name} " -o custom-columns=IMAGE:.spec.template.spec.containers[* ].image \
1261+ || oc get " deployments/${service_name} " -o custom-columns=IMAGE:.spec.template.spec.containers[* ].image ) | tail -n 1)
12581262 namespace=${CT_NAMESPACE:- " $( oc project -q) " }
12591263
1260- echo " Information about the image we work with:"
1261- oc get deploymentconfig.apps.openshift.io/" ${service_name} " -o yaml | grep lastTriggeredImage
1264+ echo " Information about the image we work with: ${image_id} "
12621265 # for s2i builds, the resulting image is actually in the current namespace,
12631266 # so if the specified namespace does not succeed, try the current namespace
12641267 oc get isimage -n " ${namespace} " " ${image_id##*/ } " -o yaml || oc get isimage " ${image_id##*/ } " -o yaml
0 commit comments