Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 5f5f513

Browse files
authored
Merge pull request sclorg#75 from coreydaley/update_templates_to_use_secrets
updating to use secrets
2 parents 6ddac81 + 02b0ec0 commit 5f5f513

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

openshift/templates/django-postgresql-persistent.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
"name": "${NAME}"
2323
},
2424
"stringData" : {
25-
"databaseUser" : "${DATABASE_USER}",
26-
"databasePassword" : "${DATABASE_PASSWORD}"
25+
"database-user" : "${DATABASE_USER}",
26+
"database-password" : "${DATABASE_PASSWORD}",
27+
"django-secret-key" : "${DJANGO_SECRET_KEY}"
2728
}
2829
},
2930
{
@@ -218,7 +219,7 @@
218219
"valueFrom": {
219220
"secretKeyRef" : {
220221
"name" : "${NAME}",
221-
"key" : "databaseUser"
222+
"key" : "database-user"
222223
}
223224
}
224225
},
@@ -227,7 +228,7 @@
227228
"valueFrom": {
228229
"secretKeyRef" : {
229230
"name" : "${NAME}",
230-
"key" : "databasePassword"
231+
"key" : "database-password"
231232
}
232233
}
233234
},
@@ -237,7 +238,12 @@
237238
},
238239
{
239240
"name": "DJANGO_SECRET_KEY",
240-
"value": "${DJANGO_SECRET_KEY}"
241+
"valueFrom": {
242+
"secretKeyRef" : {
243+
"name" : "${NAME}",
244+
"key" : "django-secret-key"
245+
}
246+
}
241247
}
242248
],
243249
"resources": {

openshift/templates/django-postgresql.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
},
2424
"stringData" : {
2525
"database-user" : "${DATABASE_USER}",
26-
"database-password" : "${DATABASE_PASSWORD}"
26+
"database-password" : "${DATABASE_PASSWORD}",
27+
"django-secret-key" : "${DJANGO_SECRET_KEY}"
2728
}
2829
},
2930
{
@@ -237,7 +238,12 @@
237238
},
238239
{
239240
"name": "DJANGO_SECRET_KEY",
240-
"value": "${DJANGO_SECRET_KEY}"
241+
"valueFrom": {
242+
"secretKeyRef" : {
243+
"name" : "${NAME}",
244+
"key" : "django-secret-key"
245+
}
246+
}
241247
}
242248
],
243249
"resources": {

openshift/templates/django.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
},
1616
"message": "The following service(s) have been created in your project: ${NAME}.\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/openshift/django-ex/blob/master/README.md.",
1717
"objects": [
18+
{
19+
"kind": "Secret",
20+
"apiVersion": "v1",
21+
"metadata": {
22+
"name": "${NAME}"
23+
},
24+
"stringData" : {
25+
"django-secret-key" : "${DJANGO_SECRET_KEY}"
26+
}
27+
},
1828
{
1929
"kind": "Service",
2030
"apiVersion": "v1",
@@ -195,7 +205,12 @@
195205
},
196206
{
197207
"name": "DJANGO_SECRET_KEY",
198-
"value": "${DJANGO_SECRET_KEY}"
208+
"valueFrom": {
209+
"secretKeyRef" : {
210+
"name" : "${NAME}",
211+
"key" : "django-secret-key"
212+
}
213+
}
199214
}
200215
],
201216
"resources": {

0 commit comments

Comments
 (0)