Affects Version/s: None
Fix Version/s: None
Currently, PUT requests on apps or groups update current app definitions instead of replacing them. If the app already exists, only the fields mentioned in the request are updated. If a field is not mentioned, it will not be removed but it remains unchanged.
If you want to delete a field, it is not possible. Even setting it explicitly to null in the JSON does not work. You have to delete the app definition first and thus cannot perform a rolling update.
It would be very nice if you could specify a complete definition which completely replaces an old one. This way the app definition could be a build artefact. The developer adjusting the build artefact doesn't have to think in terms of all possible upgrade paths but only has to specify what he wants in the future.
We cannot just change the semantics of our PUT requests without breaking API compatibility but I propose to
[update] add a boolean parameter replace. The value false would correspond to the current semantics and remain the default. If you want to replace an app definition completely, you would use PUT /v2/apps/service1?replace=true instead of PUT /v2/apps/service1.
add a Parameter op which can be either update or replace. update would correspond to the current semantics and remain the default. If you want to replace an app definition completely, you would use PUT /v2/apps/service1?op=replace instead of PUT /v2/apps/service1.
Start a simple non-docker app:
Now try to upgrade it to a dockerized version:
If you DELETE the app first and repeat the second request, it works.