-
Notifications
You must be signed in to change notification settings - Fork 841
Support app/group config replacement instead of only updates (PUT semantics) #1418
Comments
@ssk2, @ConnorDoyle For your client, it would also be nice to be able to replace app definitions fully instead of patching them. What do you think? |
That makes sense. I'd rephrase the parameter name to "replace=true" and leave update as the default behaviour (it's more intuitive than "op") - what do you think? |
@ssk2 makes sense. For me it's equally good. If it is better for you, then it's reason enough for me to change that. |
@ssk2 I checked the description above to match your proposal (hopefully ;) ) |
Looks good :) |
whether this issue has solution? marathon version 1.1.0 still confront the bug. can any one help me ? |
+1, wishes actually add |
The Marathon 1.4.0 release notes mention that PATCH semantics for PUT will be deprecated and replaced by a proper distinction in a future release. |
Note: This issue has been migrated to https://jira.mesosphere.com/browse/MARATHON-4745. For more information see https://groups.google.com/forum/#!topic/marathon-framework/khtvf-ifnp8. |
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 valuefalse
would correspond to the current semantics and remain the default. If you want to replace an app definition completely, you would usePUT /v2/apps/service1?replace=true
instead ofPUT /v2/apps/service1
.[initial version]
add a Parameterop
which can be eitherupdate
orreplace
.update
would correspond to the current semantics and remain the default. If you want to replace an app definition completely, you would usePUT /v2/apps/service1?op=replace
instead ofPUT /v2/apps/service1
.Example: Updating an App to a Dockerized Version
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.The text was updated successfully, but these errors were encountered: