Skip to content

Commit befd02e

Browse files
authored
Merge pull request #214 from bcgov/dev
Feature/scheduler fix (#213)
2 parents 4e8d9b0 + 4833ef3 commit befd02e

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

microservices/gatewayJobScheduler/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def _get_certificate_for_host(host, namespace, cert_snis, certs):
6060

6161
for sni in cert_snis:
6262
if host in sni['name']:
63-
cert_id = sni['certificate']
63+
cert_id = sni['certificate']['id']
6464
logger.debug("%s - Found custom cert with SNI match for %s - %s" % (namespace, host, cert_id))
6565
cert = next((cert for cert in certs if cert['id'] == cert_id), None)
6666
if cert is None:

microservices/gatewayJobScheduler/tests/test_get_certificate.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def test_get_certificate_custom_domain_found():
3232
"name": "test.custom.gov.bc.ca",
3333
"id": "79009c9e-0f4d-40b5-9707-bf2fe9f50502",
3434
"created_at": 1731713874,
35-
"certificate": cert_id,
35+
"certificate": {
36+
"id": cert_id
37+
},
3638
"tags": ["ns.test-ns"]
3739
}]
3840

@@ -47,7 +49,9 @@ def test_get_certificate_custom_domain_sni_not_found():
4749
namespace = "test-ns"
4850
cert_snis = [{
4951
"name": "other.custom.gov.bc.ca",
50-
"certificate": "some-cert-id"
52+
"certificate": {
53+
"id": "some-cert-id"
54+
}
5155
}]
5256
certs = []
5357

@@ -63,7 +67,9 @@ def test_get_certificate_missing_cert():
6367

6468
cert_snis = [{
6569
"name": host,
66-
"certificate": cert_id
70+
"certificate": {
71+
"id": cert_id
72+
}
6773
}]
6874
certs = [] # Empty certs list, so cert won't be found
6975

microservices/gatewayJobScheduler/tests/test_transform_data_by_ns.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def test_happy_transform_data_by_ns_with_custom_domain():
122122
"name": "test.custom.gov.bc.ca",
123123
"id": "79009c9e-0f4d-40b5-9707-bf2fe9f50502",
124124
"created_at": 1731713874,
125-
"certificate": "41d14845-669f-4dcd-aff2-926fb32a4b25",
125+
"certificate": {
126+
"id": "41d14845-669f-4dcd-aff2-926fb32a4b25"
127+
},
126128
"tags": [
127129
"ns.ns1"
128130
]
@@ -184,7 +186,9 @@ def test_missing_cert_transform_data_by_ns_with_custom_domain(caplog):
184186
"name": "other.custom.gov.bc.ca",
185187
"id": "79009c9e-0f4d-40b5-9707-bf2fe9f50502",
186188
"created_at": 1731713874,
187-
"certificate": "41d14845-669f-4dcd-aff2-926fb32a4b25",
189+
"certificate": {
190+
"id": "41d14845-669f-4dcd-aff2-926fb32a4b25"
191+
},
188192
"tags": [
189193
"ns.ns1"
190194
]

0 commit comments

Comments
 (0)