From 02b0ec0429ec7492abead500aeabbb20bad18e0d Mon Sep 17 00:00:00 2001 From: Corey Daley Date: Wed, 18 Jan 2017 12:13:16 -0500 Subject: [PATCH] updating to use secrets --- .../templates/django-postgresql-persistent.json | 16 +++++++++++----- openshift/templates/django-postgresql.json | 10 ++++++++-- openshift/templates/django.json | 17 ++++++++++++++++- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/openshift/templates/django-postgresql-persistent.json b/openshift/templates/django-postgresql-persistent.json index e3638f5..175d20e 100644 --- a/openshift/templates/django-postgresql-persistent.json +++ b/openshift/templates/django-postgresql-persistent.json @@ -22,8 +22,9 @@ "name": "${NAME}" }, "stringData" : { - "databaseUser" : "${DATABASE_USER}", - "databasePassword" : "${DATABASE_PASSWORD}" + "database-user" : "${DATABASE_USER}", + "database-password" : "${DATABASE_PASSWORD}", + "django-secret-key" : "${DJANGO_SECRET_KEY}" } }, { @@ -218,7 +219,7 @@ "valueFrom": { "secretKeyRef" : { "name" : "${NAME}", - "key" : "databaseUser" + "key" : "database-user" } } }, @@ -227,7 +228,7 @@ "valueFrom": { "secretKeyRef" : { "name" : "${NAME}", - "key" : "databasePassword" + "key" : "database-password" } } }, @@ -237,7 +238,12 @@ }, { "name": "DJANGO_SECRET_KEY", - "value": "${DJANGO_SECRET_KEY}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "django-secret-key" + } + } } ], "resources": { diff --git a/openshift/templates/django-postgresql.json b/openshift/templates/django-postgresql.json index 510b729..64b914e 100644 --- a/openshift/templates/django-postgresql.json +++ b/openshift/templates/django-postgresql.json @@ -23,7 +23,8 @@ }, "stringData" : { "database-user" : "${DATABASE_USER}", - "database-password" : "${DATABASE_PASSWORD}" + "database-password" : "${DATABASE_PASSWORD}", + "django-secret-key" : "${DJANGO_SECRET_KEY}" } }, { @@ -237,7 +238,12 @@ }, { "name": "DJANGO_SECRET_KEY", - "value": "${DJANGO_SECRET_KEY}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "django-secret-key" + } + } } ], "resources": { diff --git a/openshift/templates/django.json b/openshift/templates/django.json index d4a5464..fab8ffb 100644 --- a/openshift/templates/django.json +++ b/openshift/templates/django.json @@ -15,6 +15,16 @@ }, "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.", "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${NAME}" + }, + "stringData" : { + "django-secret-key" : "${DJANGO_SECRET_KEY}" + } + }, { "kind": "Service", "apiVersion": "v1", @@ -195,7 +205,12 @@ }, { "name": "DJANGO_SECRET_KEY", - "value": "${DJANGO_SECRET_KEY}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "django-secret-key" + } + } } ], "resources": {