diff --git a/examples/mariadb-ephemeral-template.json b/examples/mariadb-ephemeral-template.json index 7c77b6e..fffb6fa 100644 --- a/examples/mariadb-ephemeral-template.json +++ b/examples/mariadb-ephemeral-template.json @@ -61,40 +61,24 @@ } }, { - "kind": "DeploymentConfig", - "apiVersion": "apps.openshift.io/v1", + "kind": "Deployment", + "apiVersion": "apps/v1", "metadata": { "name": "${DATABASE_SERVICE_NAME}", "annotations": { - "template.alpha.openshift.io/wait-for-ready": "true" + "template.alpha.openshift.io/wait-for-ready": "true", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"mariadb:${MARIADB_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]" } }, "spec": { "strategy": { "type": "Recreate" }, - "triggers": [ - { - "type": "ImageChange", - "imageChangeParams": { - "automatic": true, - "containerNames": [ - "mariadb" - ], - "from": { - "kind": "ImageStreamTag", - "name": "mariadb:${MARIADB_VERSION}", - "namespace": "${NAMESPACE}" - } - } - }, - { - "type": "ConfigChange" - } - ], "replicas": 1, "selector": { - "name": "${DATABASE_SERVICE_NAME}" + "matchLabels": { + "name": "${DATABASE_SERVICE_NAME}" + } }, "template": { "metadata": { diff --git a/examples/mariadb-persistent-template.json b/examples/mariadb-persistent-template.json index 1a90791..0294880 100644 --- a/examples/mariadb-persistent-template.json +++ b/examples/mariadb-persistent-template.json @@ -78,40 +78,24 @@ } }, { - "kind": "DeploymentConfig", - "apiVersion": "apps.openshift.io/v1", + "kind": "Deployment", + "apiVersion": "apps/v1", "metadata": { "name": "${DATABASE_SERVICE_NAME}", "annotations": { - "template.alpha.openshift.io/wait-for-ready": "true" + "template.alpha.openshift.io/wait-for-ready": "true", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"mariadb:${MARIADB_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]" } }, "spec": { "strategy": { "type": "Recreate" }, - "triggers": [ - { - "type": "ImageChange", - "imageChangeParams": { - "automatic": true, - "containerNames": [ - "mariadb" - ], - "from": { - "kind": "ImageStreamTag", - "name": "mariadb:${MARIADB_VERSION}", - "namespace": "${NAMESPACE}" - } - } - }, - { - "type": "ConfigChange" - } - ], "replicas": 1, "selector": { - "name": "${DATABASE_SERVICE_NAME}" + "matchLabels": { + "name": "${DATABASE_SERVICE_NAME}" + } }, "template": { "metadata": { diff --git a/test/test-lib-mysql.sh b/test/test-lib-mysql.sh index 326a049..63a6760 100755 --- a/test/test-lib-mysql.sh +++ b/test/test-lib-mysql.sh @@ -116,11 +116,17 @@ function test_mariadb_integration() { local service_name=mariadb TEMPLATES="mariadb-ephemeral-template.json mariadb-persistent-template.json" + SHORT_VERSION="${VERSION//.}" + if [ "${OS}" == "rhel7" ]; then + namespace_image="rhscl/mariadb-${SHORT_VERSION}-rhel7" + else + namespace_image="${OS}/mariadb-${SHORT_VERSION}" + fi for template in $TEMPLATES; do ct_os_test_template_app_func "${IMAGE_NAME}" \ "${THISDIR}/${template}" \ "${service_name}" \ - "ct_os_check_cmd_internal '' '${service_name}-testing' \"echo 'SELECT 42 as testval\g' | mysql --connect-timeout=15 -h testdb -utestu -ptestp\" '^42' 120" \ + "ct_os_check_cmd_internal 'registry.redhat.io/${namespace_image}' '${service_name}-testing' \"echo 'SELECT 42 as testval\g' | mysql --connect-timeout=15 -h testdb -utestu -ptestp\" '^42' 120" \ "-p MARIADB_VERSION=${VERSION} \ -p DATABASE_SERVICE_NAME="${service_name}-testing" \ -p MYSQL_USER=testu \ @@ -137,13 +143,22 @@ function test_mariadb_imagestream() { elif [ "${OS}" == "rhel9" ]; then tag="-el9" fi - ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS%[0-9]*}.json" "${THISDIR}/examples/mariadb-ephemeral-template.json" mariadb "-p MARIADB_VERSION=${VERSION}${tag}" + TEMPLATES="mariadb-ephemeral-template.json + mariadb-persistent-template.json" + for template in $TEMPLATES; do + ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS%[0-9]*}.json" "${THISDIR}/examples/${template}" mariadb "-p MARIADB_VERSION=${VERSION}${tag}" + done } function test_mariadb_template() { - ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS%[0-9]*}.json" "${THISDIR}/mariadb-ephemeral-template.json" mariadb + TEMPLATES="mariadb-ephemeral-template.json + mariadb-persistent-template.json" + for template in $TEMPLATES; do + ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS%[0-9]*}.json" "${THISDIR}/examples/${template}" mariadb + done } + # Check the latest imagestreams function run_latest_imagestreams() { local result=1