appuio / cloud-portal

APPUiO Cloud Portal (Web Frontend)
Apache License 2.0
5 stars 0 forks source link

Portal must use server-side merge when updating manifests #520

Closed bastjan closed 1 year ago

bastjan commented 1 year ago

Description

During the rollout of Billing Entities we noticed problems updating the Organizations through the portal. kubectl edit did not show the same issues.

The underlying issue was a combination of the forgotten idp adapter https://github.com/vshn/appuio-keycloak-adapter/pull/44 and the portal not passing the .metadata.finalizers field.

While the immediate issue is fixed this problem will happen again in the future when portal and control api are out of sync.

The portal tells Kubernetes (with a PUT request) to override the live object with the version in the request. All fields not in the request are zeroed. Kubernetes does support server side merging which allows to override only fields contained in the request. The portal should start to tell kubernetes to only update fields the portal knows with a PATCH application/merge-patch+json request.

Also see https://github.com/vshn/appuio-keycloak-adapter/issues/47.

Additional Context

No response

Logs

No response

Expected Behavior

PATCH ...
Content-Type: application/merge-patch+json

(or similar) is used by the portal

Steps To Reproduce

No response