From 1362c2ff2396921b21f05cc48d8cea114da2985f Mon Sep 17 00:00:00 2001 From: Lukas Krejci Date: Fri, 20 Sep 2024 17:03:29 +0200 Subject: [PATCH 1/2] Fix the rails template before the upstream accepts or PR (https://github.com/sclorg/rails-ex/pull/178). --- .../templates/rails-pgsql-persistent.json | 4 +- .../templates/rails-postgresql-example.json | 86 ++++++++++++++++++- 2 files changed, 85 insertions(+), 5 deletions(-) diff --git a/assets/operator/ocp-x86_64/rails/templates/rails-pgsql-persistent.json b/assets/operator/ocp-x86_64/rails/templates/rails-pgsql-persistent.json index 824fcb3f9..e302c40a8 100755 --- a/assets/operator/ocp-x86_64/rails/templates/rails-pgsql-persistent.json +++ b/assets/operator/ocp-x86_64/rails/templates/rails-pgsql-persistent.json @@ -403,7 +403,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -663,4 +663,4 @@ "app": "rails-pgsql-persistent", "template": "rails-pgsql-persistent" } -} \ No newline at end of file +} diff --git a/assets/operator/ocp-x86_64/rails/templates/rails-postgresql-example.json b/assets/operator/ocp-x86_64/rails/templates/rails-postgresql-example.json index 226c466f1..847c7d422 100755 --- a/assets/operator/ocp-x86_64/rails/templates/rails-postgresql-example.json +++ b/assets/operator/ocp-x86_64/rails/templates/rails-postgresql-example.json @@ -142,7 +142,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the application server", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"},{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.initContainers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${NAME}" @@ -278,6 +278,86 @@ } } } + ], + "initContainers": [ + { + "command": [ + "./migrate-database.sh" + ], + "env": [ + { + "name": "DATABASE_SERVICE_NAME", + "value": "${DATABASE_SERVICE_NAME}" + }, + { + "name": "POSTGRESQL_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "${NAME}" + } + } + }, + { + "name": "SECRET_KEY_BASE", + "valueFrom": { + "secretKeyRef": { + "key": "keybase", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_DATABASE", + "value": "${DATABASE_NAME}" + }, + { + "name": "POSTGRESQL_MAX_CONNECTIONS", + "value": "${POSTGRESQL_MAX_CONNECTIONS}" + }, + { + "name": "POSTGRESQL_SHARED_BUFFERS", + "value": "${POSTGRESQL_SHARED_BUFFERS}" + }, + { + "name": "APPLICATION_DOMAIN", + "value": "${APPLICATION_DOMAIN}" + }, + { + "name": "APPLICATION_USER", + "valueFrom": { + "secretKeyRef": { + "key": "application-user", + "name": "${NAME}" + } + } + }, + { + "name": "APPLICATION_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "application-password", + "name": "${NAME}" + } + } + }, + { + "name": "RAILS_ENV", + "value": "${RAILS_ENV}" + } + ], + "image": " ", + "name": "ruby-init-container" + } ] } } @@ -311,7 +391,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -555,4 +635,4 @@ "app": "rails-postgresql-example", "template": "rails-postgresql-example" } -} \ No newline at end of file +} From cccebd3ced1f2e461f88c1469f96116db2898b2e Mon Sep 17 00:00:00 2001 From: Lukas Krejci Date: Fri, 20 Sep 2024 17:12:04 +0200 Subject: [PATCH 2/2] Copy the changed rails template to the rest of the archs. --- .../templates/rails-pgsql-persistent.json | 4 +- .../templates/rails-postgresql-example.json | 86 ++++++++++++++++++- .../templates/rails-pgsql-persistent.json | 4 +- .../templates/rails-postgresql-example.json | 86 ++++++++++++++++++- .../templates/rails-pgsql-persistent.json | 4 +- .../templates/rails-postgresql-example.json | 86 ++++++++++++++++++- .../templates/rails-pgsql-persistent.json | 4 +- .../templates/rails-postgresql-example.json | 86 ++++++++++++++++++- 8 files changed, 340 insertions(+), 20 deletions(-) diff --git a/assets/operator/ocp-aarch64/rails/templates/rails-pgsql-persistent.json b/assets/operator/ocp-aarch64/rails/templates/rails-pgsql-persistent.json index 824fcb3f9..e302c40a8 100755 --- a/assets/operator/ocp-aarch64/rails/templates/rails-pgsql-persistent.json +++ b/assets/operator/ocp-aarch64/rails/templates/rails-pgsql-persistent.json @@ -403,7 +403,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -663,4 +663,4 @@ "app": "rails-pgsql-persistent", "template": "rails-pgsql-persistent" } -} \ No newline at end of file +} diff --git a/assets/operator/ocp-aarch64/rails/templates/rails-postgresql-example.json b/assets/operator/ocp-aarch64/rails/templates/rails-postgresql-example.json index 226c466f1..847c7d422 100755 --- a/assets/operator/ocp-aarch64/rails/templates/rails-postgresql-example.json +++ b/assets/operator/ocp-aarch64/rails/templates/rails-postgresql-example.json @@ -142,7 +142,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the application server", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"},{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.initContainers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${NAME}" @@ -278,6 +278,86 @@ } } } + ], + "initContainers": [ + { + "command": [ + "./migrate-database.sh" + ], + "env": [ + { + "name": "DATABASE_SERVICE_NAME", + "value": "${DATABASE_SERVICE_NAME}" + }, + { + "name": "POSTGRESQL_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "${NAME}" + } + } + }, + { + "name": "SECRET_KEY_BASE", + "valueFrom": { + "secretKeyRef": { + "key": "keybase", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_DATABASE", + "value": "${DATABASE_NAME}" + }, + { + "name": "POSTGRESQL_MAX_CONNECTIONS", + "value": "${POSTGRESQL_MAX_CONNECTIONS}" + }, + { + "name": "POSTGRESQL_SHARED_BUFFERS", + "value": "${POSTGRESQL_SHARED_BUFFERS}" + }, + { + "name": "APPLICATION_DOMAIN", + "value": "${APPLICATION_DOMAIN}" + }, + { + "name": "APPLICATION_USER", + "valueFrom": { + "secretKeyRef": { + "key": "application-user", + "name": "${NAME}" + } + } + }, + { + "name": "APPLICATION_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "application-password", + "name": "${NAME}" + } + } + }, + { + "name": "RAILS_ENV", + "value": "${RAILS_ENV}" + } + ], + "image": " ", + "name": "ruby-init-container" + } ] } } @@ -311,7 +391,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -555,4 +635,4 @@ "app": "rails-postgresql-example", "template": "rails-postgresql-example" } -} \ No newline at end of file +} diff --git a/assets/operator/ocp-ppc64le/rails/templates/rails-pgsql-persistent.json b/assets/operator/ocp-ppc64le/rails/templates/rails-pgsql-persistent.json index 824fcb3f9..e302c40a8 100755 --- a/assets/operator/ocp-ppc64le/rails/templates/rails-pgsql-persistent.json +++ b/assets/operator/ocp-ppc64le/rails/templates/rails-pgsql-persistent.json @@ -403,7 +403,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -663,4 +663,4 @@ "app": "rails-pgsql-persistent", "template": "rails-pgsql-persistent" } -} \ No newline at end of file +} diff --git a/assets/operator/ocp-ppc64le/rails/templates/rails-postgresql-example.json b/assets/operator/ocp-ppc64le/rails/templates/rails-postgresql-example.json index 226c466f1..847c7d422 100755 --- a/assets/operator/ocp-ppc64le/rails/templates/rails-postgresql-example.json +++ b/assets/operator/ocp-ppc64le/rails/templates/rails-postgresql-example.json @@ -142,7 +142,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the application server", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"},{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.initContainers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${NAME}" @@ -278,6 +278,86 @@ } } } + ], + "initContainers": [ + { + "command": [ + "./migrate-database.sh" + ], + "env": [ + { + "name": "DATABASE_SERVICE_NAME", + "value": "${DATABASE_SERVICE_NAME}" + }, + { + "name": "POSTGRESQL_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "${NAME}" + } + } + }, + { + "name": "SECRET_KEY_BASE", + "valueFrom": { + "secretKeyRef": { + "key": "keybase", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_DATABASE", + "value": "${DATABASE_NAME}" + }, + { + "name": "POSTGRESQL_MAX_CONNECTIONS", + "value": "${POSTGRESQL_MAX_CONNECTIONS}" + }, + { + "name": "POSTGRESQL_SHARED_BUFFERS", + "value": "${POSTGRESQL_SHARED_BUFFERS}" + }, + { + "name": "APPLICATION_DOMAIN", + "value": "${APPLICATION_DOMAIN}" + }, + { + "name": "APPLICATION_USER", + "valueFrom": { + "secretKeyRef": { + "key": "application-user", + "name": "${NAME}" + } + } + }, + { + "name": "APPLICATION_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "application-password", + "name": "${NAME}" + } + } + }, + { + "name": "RAILS_ENV", + "value": "${RAILS_ENV}" + } + ], + "image": " ", + "name": "ruby-init-container" + } ] } } @@ -311,7 +391,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -555,4 +635,4 @@ "app": "rails-postgresql-example", "template": "rails-postgresql-example" } -} \ No newline at end of file +} diff --git a/assets/operator/ocp-s390x/rails/templates/rails-pgsql-persistent.json b/assets/operator/ocp-s390x/rails/templates/rails-pgsql-persistent.json index 824fcb3f9..e302c40a8 100755 --- a/assets/operator/ocp-s390x/rails/templates/rails-pgsql-persistent.json +++ b/assets/operator/ocp-s390x/rails/templates/rails-pgsql-persistent.json @@ -403,7 +403,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -663,4 +663,4 @@ "app": "rails-pgsql-persistent", "template": "rails-pgsql-persistent" } -} \ No newline at end of file +} diff --git a/assets/operator/ocp-s390x/rails/templates/rails-postgresql-example.json b/assets/operator/ocp-s390x/rails/templates/rails-postgresql-example.json index 226c466f1..847c7d422 100755 --- a/assets/operator/ocp-s390x/rails/templates/rails-postgresql-example.json +++ b/assets/operator/ocp-s390x/rails/templates/rails-postgresql-example.json @@ -142,7 +142,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the application server", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"},{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.initContainers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${NAME}" @@ -278,6 +278,86 @@ } } } + ], + "initContainers": [ + { + "command": [ + "./migrate-database.sh" + ], + "env": [ + { + "name": "DATABASE_SERVICE_NAME", + "value": "${DATABASE_SERVICE_NAME}" + }, + { + "name": "POSTGRESQL_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "${NAME}" + } + } + }, + { + "name": "SECRET_KEY_BASE", + "valueFrom": { + "secretKeyRef": { + "key": "keybase", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_DATABASE", + "value": "${DATABASE_NAME}" + }, + { + "name": "POSTGRESQL_MAX_CONNECTIONS", + "value": "${POSTGRESQL_MAX_CONNECTIONS}" + }, + { + "name": "POSTGRESQL_SHARED_BUFFERS", + "value": "${POSTGRESQL_SHARED_BUFFERS}" + }, + { + "name": "APPLICATION_DOMAIN", + "value": "${APPLICATION_DOMAIN}" + }, + { + "name": "APPLICATION_USER", + "valueFrom": { + "secretKeyRef": { + "key": "application-user", + "name": "${NAME}" + } + } + }, + { + "name": "APPLICATION_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "application-password", + "name": "${NAME}" + } + } + }, + { + "name": "RAILS_ENV", + "value": "${RAILS_ENV}" + } + ], + "image": " ", + "name": "ruby-init-container" + } ] } } @@ -311,7 +391,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -555,4 +635,4 @@ "app": "rails-postgresql-example", "template": "rails-postgresql-example" } -} \ No newline at end of file +} diff --git a/assets/operator/okd-x86_64/rails/templates/rails-pgsql-persistent.json b/assets/operator/okd-x86_64/rails/templates/rails-pgsql-persistent.json index 824fcb3f9..e302c40a8 100755 --- a/assets/operator/okd-x86_64/rails/templates/rails-pgsql-persistent.json +++ b/assets/operator/okd-x86_64/rails/templates/rails-pgsql-persistent.json @@ -403,7 +403,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -663,4 +663,4 @@ "app": "rails-pgsql-persistent", "template": "rails-pgsql-persistent" } -} \ No newline at end of file +} diff --git a/assets/operator/okd-x86_64/rails/templates/rails-postgresql-example.json b/assets/operator/okd-x86_64/rails/templates/rails-postgresql-example.json index 226c466f1..847c7d422 100755 --- a/assets/operator/okd-x86_64/rails/templates/rails-postgresql-example.json +++ b/assets/operator/okd-x86_64/rails/templates/rails-postgresql-example.json @@ -142,7 +142,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the application server", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"},{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.initContainers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${NAME}" @@ -278,6 +278,86 @@ } } } + ], + "initContainers": [ + { + "command": [ + "./migrate-database.sh" + ], + "env": [ + { + "name": "DATABASE_SERVICE_NAME", + "value": "${DATABASE_SERVICE_NAME}" + }, + { + "name": "POSTGRESQL_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "${NAME}" + } + } + }, + { + "name": "SECRET_KEY_BASE", + "valueFrom": { + "secretKeyRef": { + "key": "keybase", + "name": "${NAME}" + } + } + }, + { + "name": "POSTGRESQL_DATABASE", + "value": "${DATABASE_NAME}" + }, + { + "name": "POSTGRESQL_MAX_CONNECTIONS", + "value": "${POSTGRESQL_MAX_CONNECTIONS}" + }, + { + "name": "POSTGRESQL_SHARED_BUFFERS", + "value": "${POSTGRESQL_SHARED_BUFFERS}" + }, + { + "name": "APPLICATION_DOMAIN", + "value": "${APPLICATION_DOMAIN}" + }, + { + "name": "APPLICATION_USER", + "valueFrom": { + "secretKeyRef": { + "key": "application-user", + "name": "${NAME}" + } + } + }, + { + "name": "APPLICATION_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "application-password", + "name": "${NAME}" + } + } + }, + { + "name": "RAILS_ENV", + "value": "${RAILS_ENV}" + } + ], + "image": " ", + "name": "ruby-init-container" + } ] } } @@ -311,7 +391,7 @@ "metadata": { "annotations": { "description": "Defines how to deploy the database", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\", \"namespace\": \"openshift\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]", "template.alpha.openshift.io/wait-for-ready": "true" }, "name": "${DATABASE_SERVICE_NAME}" @@ -555,4 +635,4 @@ "app": "rails-postgresql-example", "template": "rails-postgresql-example" } -} \ No newline at end of file +}