Skip to content

Fix the env variables added by the keycloak components

Alain Thioliere requested to merge ath/keycloak_access_to_identity_provider into main

What does this MR do and why?

The keycloak kustomization has two components which want to add elements to an arrayt env in a Keycloak CR. These components add on one hand an array with proxy variables, and on the other hand keycloak variables to set the truststore. In the way it is written, the last component (truststore in our case) wins, and replaces the env array with the variables related to truststore.

This MR makes the components add the environment variables one by one, so that we end up with the environment variables requested by the two components, whatever the order of the components is.

This MR fixes an issue when integrating keycloak with an external IDP reachable behind a proxy: even though the http proxy component is present in the kustomization, the proxy variables are not set in the resulting keycloak pod because they are overwritten by the truststore component.

Related reference(s)

https://stackoverflow.com/questions/59849760/add-multiple-values-to-array-in-single-json-patch-operation explains the problem with adding multiple elements to an array with patches.

Test coverage

Edited by Alain Thioliere

Merge request reports