From ddcb7a306bbcae35f0a6d0436fe693d36a3a4988 Mon Sep 17 00:00:00 2001 From: Hunor Csomortáni Date: May 14 2018 11:21:14 +0000 Subject: [PATCH 1/3] Change AUTH_METHOD to 'dummy' For testing purposes let's not require authantication. This updates the test template to use the 'dummy' auth method. Signed-off-by: Hunor Csomortáni --- diff --git a/openshift/waiverdb-test-template.yaml b/openshift/waiverdb-test-template.yaml index ff230ae..a879a47 100644 --- a/openshift/waiverdb-test-template.yaml +++ b/openshift/waiverdb-test-template.yaml @@ -61,7 +61,7 @@ objects: settings.py: |- DATABASE_URI = 'postgresql+psycopg2://waiverdb@waiverdb-test-${TEST_ID}-database:5432/waiverdb' PORT = 8080 - AUTH_METHOD = 'OIDC' + AUTH_METHOD = 'dummy' OIDC_CLIENT_SECRETS = '/etc/secret/client_secrets.json' RESULTSDB_API_URL = 'https://resultsdb-api.engineering.redhat.com/api/v2.0' - apiVersion: v1 From 99b4273341f671e10c7967f0d473224fefe228ec Mon Sep 17 00:00:00 2001 From: Hunor Csomortáni Date: May 14 2018 11:22:45 +0000 Subject: [PATCH 2/3] Stop publishing to the messages bus Testing environments don't have a message bus available yet. Update the OpenShift test template to disable publishing to the message bus. Signed-off-by: Hunor Csomortáni --- diff --git a/openshift/waiverdb-test-template.yaml b/openshift/waiverdb-test-template.yaml index a879a47..1cf5c1d 100644 --- a/openshift/waiverdb-test-template.yaml +++ b/openshift/waiverdb-test-template.yaml @@ -64,6 +64,7 @@ objects: AUTH_METHOD = 'dummy' OIDC_CLIENT_SECRETS = '/etc/secret/client_secrets.json' RESULTSDB_API_URL = 'https://resultsdb-api.engineering.redhat.com/api/v2.0' + MESSAGE_BUS_PUBLISH = False - apiVersion: v1 kind: Service metadata: From 61c8c0045c08ef04ba71ffe26ba0471c7788901a Mon Sep 17 00:00:00 2001 From: Hunor Csomortáni Date: May 14 2018 11:24:41 +0000 Subject: [PATCH 3/3] Add 'app' label to the test template This enables deploying WaiverDB in a project where other apps are also available. Signed-off-by: Hunor Csomortáni --- diff --git a/openshift/waiverdb-test-template.yaml b/openshift/waiverdb-test-template.yaml index 1cf5c1d..6122011 100644 --- a/openshift/waiverdb-test-template.yaml +++ b/openshift/waiverdb-test-template.yaml @@ -37,6 +37,7 @@ objects: name: "waiverdb-test-${TEST_ID}-secret" labels: environment: "test-${TEST_ID}" + app: waiverdb stringData: flask-secret-key: "${FLASK_SECRET_KEY}" database-password: "${DATABASE_PASSWORD}" @@ -57,6 +58,7 @@ objects: name: "waiverdb-test-${TEST_ID}-configmap" labels: environment: "test-${TEST_ID}" + app: waiverdb data: settings.py: |- DATABASE_URI = 'postgresql+psycopg2://waiverdb@waiverdb-test-${TEST_ID}-database:5432/waiverdb' @@ -71,9 +73,11 @@ objects: name: "waiverdb-test-${TEST_ID}-database" labels: environment: "test-${TEST_ID}" + app: waiverdb spec: selector: environment: "test-${TEST_ID}" + app: waiverdb service: database ports: - name: postgresql @@ -85,6 +89,7 @@ objects: name: "waiverdb-test-${TEST_ID}-database" labels: environment: "test-${TEST_ID}" + app: waiverdb service: database spec: replicas: 1 @@ -92,11 +97,13 @@ objects: type: Recreate selector: environment: "test-${TEST_ID}" + app: waiverdb service: database template: metadata: labels: environment: "test-${TEST_ID}" + app: waiverdb service: database spec: containers: @@ -133,12 +140,14 @@ objects: name: "waiverdb-test-${TEST_ID}-web" labels: environment: "test-${TEST_ID}" + app: waiverdb annotations: service.alpha.openshift.io/dependencies: |- [{"name": "waiverdb-test-${TEST_ID}-database", "kind": "Service"}] spec: selector: environment: "test-${TEST_ID}" + app: waiverdb service: web ports: - name: web @@ -150,6 +159,7 @@ objects: name: "waiverdb-test-${TEST_ID}-web" labels: environment: "test-${TEST_ID}" + app: waiverdb spec: port: targetPort: web @@ -165,11 +175,13 @@ objects: name: "waiverdb-test-${TEST_ID}-web" labels: environment: "test-${TEST_ID}" + app: waiverdb service: web spec: replicas: 2 selector: environment: "test-${TEST_ID}" + app: waiverdb service: web strategy: type: Rolling @@ -186,6 +198,7 @@ objects: metadata: labels: environment: "test-${TEST_ID}" + app: waiverdb service: web spec: containers: