Implement Swarm update handler using PUT
This commit implements an update handler for Docker Swarm, it queries the
current spec, updates values in-situ before calling ServiceUpdate.
The UpdateConfig FailureAction is set to rollback, so in the event of
supplying values to the update that would result in the service failing
then the update will be rolled back.
The UpdateConfig Parallelism param is set to an explicit value of 1 which
will result in functions being updated 1 by 1 rather than all at once.
It also moves the restartDelay declaration out of the create and update
handlers and into the main server function alongside maxRestarts.
And finally this commit uses the PUT HTTP verb for updates rather than
the non-HTTP UPDATE verb which was being used initially (also adding it
to the Swagger definition).
Signed-off-by:
John McCabe <john@johnmccabe.net>
Showing
- api-docs/swagger.yml 17 additions, 0 deletionsapi-docs/swagger.yml
- gateway/handlers/createhandler.go 17 additions, 12 deletionsgateway/handlers/createhandler.go
- gateway/handlers/update_handler.go 106 additions, 3 deletionsgateway/handlers/update_handler.go
- gateway/server.go 5 additions, 3 deletionsgateway/server.go
Please register or sign in to comment