Potentially update status with non-matching application
From Aleksandra:
if you call this function with non matching resources (application A from OKD4, and application B from ApplicationPortal) you will overwrite A with B. Is this something that you want? In the usual scenario one checks for the ID equality to rule out that the function is called with incorrect arguments.
We don't have such a use case. AFAIR this function just assumes that it's being called with matching A,B and naively proceeds to check every value.
First check that app.ID == apiApp.ID
for robustness.