Skip to content

Commit

Permalink
Migration DeploymentConfigs to Deployment
Browse files Browse the repository at this point in the history
See more info here:
https://docs.openshift.com/container-platform/4.12/applications/deployments/what-deployments-are.html

Since OPenShift 4.14 DeploymentConfigs are deprecated: https://access.redhat.com/articles/7041372

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Nov 30, 2023
1 parent e1fc0b8 commit b5be1ca
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 51 deletions.
32 changes: 8 additions & 24 deletions examples/mariadb-ephemeral-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
"type": "RollingUpdate"
},
"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": {
Expand Down
32 changes: 8 additions & 24 deletions examples/mariadb-persistent-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
"type": "RollingUpdate"
},
"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": {
Expand Down
2 changes: 1 addition & 1 deletion test/run-openshift-remote-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source "${THISDIR}/test-lib-remote-openshift.sh"
TEST_LIST="\
test_mariadb_integration
test_mariadb_imagestream
test_mariadb_template
test_mariadb_templates
run_latest_imagestreams
"

Expand Down
9 changes: 7 additions & 2 deletions test/test-lib-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,15 @@ function test_mariadb_imagestream() {
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}"
}

function test_mariadb_template() {
ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS%[0-9]*}.json" "${THISDIR}/mariadb-ephemeral-template.json" mariadb
function test_mariadb_templates() {
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}/${template}" mariadb
done
}


# Check the latest imagestreams
function run_latest_imagestreams() {
local result=1
Expand Down

0 comments on commit b5be1ca

Please sign in to comment.