Commit 62bd0de
authored
fix(keycloak): Add support for Keycloak version >=25 (#694)
Keycloak changed the health endpoint to a separate "management port"
starting version 25.0.0 as can be read in the
[changelogs](https://www.keycloak.org/docs/25.0.0/release_notes/#management-port-for-metrics-and-health-endpoints).
The keycloak module in testcontainers-python uses this endpoint for the
readiness_probe. Currently compatibility with Keycloak >= 25 is broken.
This MR adds compatibility with Keycloak >= 25 by changing the readiness
probe to do the following:
- Try the health endpoint on the management port
- If that gives a ConnectionError try the legacy health endpoint
An alternative approach would have been to create a separate
LegacyKeycloakContainer class as has been done in other modules, however
I think this unnecessarily complicates the user experience.
Additionally a public `get_management_url` method has been added to give
end-users convenient access to the new Keycloak management endpoint.1 parent 935693e commit 62bd0de
File tree
2 files changed
+16
-4
lines changed- modules/keycloak
- testcontainers/keycloak
- tests
2 files changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
77 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
0 commit comments