Skip to content

Commit 2882158

Browse files
authored
Merge pull request sclorg#540 from sclorg/migrate_deployment
Migrate DeploymentsConfig to Deployment
2 parents 44724a4 + e7579c9 commit 2882158

File tree

3 files changed

+25
-51
lines changed

3 files changed

+25
-51
lines changed

Diff for: examples/postgresql-ephemeral-template.json

+7-24
Original file line numberDiff line numberDiff line change
@@ -66,41 +66,24 @@
6666
}
6767
},
6868
{
69-
"kind": "DeploymentConfig",
70-
"apiVersion": "apps.openshift.io/v1",
69+
"kind": "Deployment",
70+
"apiVersion": "apps/v1",
7171
"metadata": {
7272
"name": "${DATABASE_SERVICE_NAME}",
7373
"annotations": {
74-
"template.alpha.openshift.io/wait-for-ready": "true"
74+
"template.alpha.openshift.io/wait-for-ready": "true",
75+
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
7576
}
7677
},
7778
"spec": {
7879
"strategy": {
7980
"type": "Recreate"
8081
},
81-
"triggers": [
82-
{
83-
"type": "ImageChange",
84-
"imageChangeParams": {
85-
"automatic": true,
86-
"containerNames": [
87-
"postgresql"
88-
],
89-
"from": {
90-
"kind": "ImageStreamTag",
91-
"name": "postgresql:${POSTGRESQL_VERSION}",
92-
"namespace": "${NAMESPACE}"
93-
},
94-
"lastTriggeredImage": ""
95-
}
96-
},
97-
{
98-
"type": "ConfigChange"
99-
}
100-
],
10182
"replicas": 1,
10283
"selector": {
103-
"name": "${DATABASE_SERVICE_NAME}"
84+
"matchLabels": {
85+
"name": "${DATABASE_SERVICE_NAME}"
86+
}
10487
},
10588
"template": {
10689
"metadata": {

Diff for: examples/postgresql-persistent-template.json

+7-24
Original file line numberDiff line numberDiff line change
@@ -83,41 +83,24 @@
8383
}
8484
},
8585
{
86-
"kind": "DeploymentConfig",
87-
"apiVersion": "apps.openshift.io/v1",
86+
"kind": "Deployment",
87+
"apiVersion": "apps/v1",
8888
"metadata": {
8989
"name": "${DATABASE_SERVICE_NAME}",
9090
"annotations": {
91-
"template.alpha.openshift.io/wait-for-ready": "true"
91+
"template.alpha.openshift.io/wait-for-ready": "true",
92+
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
9293
}
9394
},
9495
"spec": {
9596
"strategy": {
9697
"type": "Recreate"
9798
},
98-
"triggers": [
99-
{
100-
"type": "ImageChange",
101-
"imageChangeParams": {
102-
"automatic": true,
103-
"containerNames": [
104-
"postgresql"
105-
],
106-
"from": {
107-
"kind": "ImageStreamTag",
108-
"name": "postgresql:${POSTGRESQL_VERSION}",
109-
"namespace": "${NAMESPACE}"
110-
},
111-
"lastTriggeredImage": ""
112-
}
113-
},
114-
{
115-
"type": "ConfigChange"
116-
}
117-
],
11899
"replicas": 1,
119100
"selector": {
120-
"name": "${DATABASE_SERVICE_NAME}"
101+
"matchLabels": {
102+
"name": "${DATABASE_SERVICE_NAME}"
103+
}
121104
},
122105
"template": {
123106
"metadata": {

Diff for: test/test-lib-postgresql.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@ source "${THISDIR}"/test-lib-remote-openshift.sh
1414

1515
function test_postgresql_integration() {
1616
local service_name=postgresql
17+
if [ "${OS}" == "rhel7" ]; then
18+
namespace_image="rhscl/postgresql-${VERSION}-rhel7"
19+
else
20+
namespace_image="${OS}/postgresql-${VERSION}"
21+
fi
1722
TEMPLATES="postgresql-ephemeral-template.json
1823
postgresql-persistent-template.json"
1924
for template in $TEMPLATES; do
2025
ct_os_test_template_app_func "${IMAGE_NAME}" \
2126
"${THISDIR}/examples/${template}" \
2227
"${service_name}" \
23-
"ct_os_check_cmd_internal '<SAME_IMAGE>' '${service_name}-testing' 'PGPASSWORD=testp pg_isready -t 15 -h <IP> -U testu -d testdb' 'accepting connections' 120" \
28+
"ct_os_check_cmd_internal 'registry.redhat.io/${namespace_image}' '${service_name}-testing' 'PGPASSWORD=testp pg_isready -t 15 -h <IP> -U testu -d testdb' 'accepting connections' 120" \
2429
"-p POSTGRESQL_VERSION=${VERSION} \
2530
-p DATABASE_SERVICE_NAME="${service_name}-testing" \
2631
-p POSTGRESQL_USER=testu \
@@ -37,8 +42,11 @@ function test_postgresql_imagestream() {
3742
elif [ "${OS}" == "rhel9" ]; then
3843
tag="-el9"
3944
fi
40-
41-
ct_os_test_image_stream_template "${THISDIR}/imagestreams/postgresql-${OS%[0-9]*}.json" "${THISDIR}/examples/postgresql-ephemeral-template.json" postgresql "-p POSTGRESQL_VERSION=${VERSION}${tag}"
45+
TEMPLATES="postgresql-ephemeral-template.json
46+
postgresql-persistent-template.json"
47+
for template in $TEMPLATES; do
48+
ct_os_test_image_stream_template "${THISDIR}/imagestreams/postgresql-${OS%[0-9]*}.json" "${THISDIR}/examples/${template}" postgresql "-p POSTGRESQL_VERSION=${VERSION}${tag}"
49+
done
4250
}
4351

4452

0 commit comments

Comments
 (0)