Skip to content

Commit 4e515f9

Browse files
committed
fix(open-xchange): stop keycloak-sync from reverting mail identity on every run
The change SOAP call (runs every 15 min, for existing accounts) was unconditionally resetting primaryEmail/email1 back to Keycloak's email on every sync - silently undoing any account customized to use a different mail identity than the Keycloak login domain (hit this in production: kept reverting kubeaid.io swaps back to obmondo.com every 15 minutes, had to suspend the CronJob entirely to stop it). change now only touches name fields (given_name/sur_name/display_name) - its actual job, keeping display names in sync. create (for genuinely new accounts) still sets primaryEmail/email1 once, unaffected. Signed-off-by: Rishi <rishi@obmondo.com>
1 parent f0064a3 commit 4e515f9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

argocd-helm-charts/open-xchange/templates/keycloak-sync-cronjob.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ data:
218218
219219
# Runs unconditionally (not just on create failure) so an existing
220220
# user's name gets refreshed if it changed in Keycloak since last sync.
221+
# Deliberately does NOT touch primaryEmail/email1 - an account's mail
222+
# identity can be customized to differ from the Keycloak login domain
223+
# (e.g. a test domain), and this sync must not fight that on every run.
224+
# create (above) still sets them once, for genuinely new accounts only.
221225
curl -s -X POST "$OX_SOAP_URL" -H "Content-Type: text/xml" --data-binary @- <<SOAPEOF > /tmp/change_response.xml 2>&1
222226
<?xml version="1.0" encoding="UTF-8"?>
223227
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.admin.openexchange.com">
@@ -229,8 +233,6 @@ data:
229233
<given_name>${FIRSTNAME_X}</given_name>
230234
<sur_name>${LASTNAME_X}</sur_name>
231235
<display_name>${DISPLAYNAME_X}</display_name>
232-
<primaryEmail>${EMAIL_X}</primaryEmail>
233-
<email1>${EMAIL_X}</email1>
234236
</usrdata>
235237
<auth>
236238
<login>${OX_ADMIN}</login>

0 commit comments

Comments
 (0)