coreos/etcd — pull request #278 by benbjohnson (2013-10-29 21:31:46+00:00)
Title: Add version upgrade endpoint.

## Overview

I added an endpoint for upgrading the cluster manually. Since v2 is the first version that supports internal versioning, there's no upgrade to be done. Also, since new versions will probably have some kind of migration code I'm only allowing upgrades of a single version at a time.

## Changes

* Added `PeerServer#Upgradable()` that checks if the next version is compatible with all nodes in the cluster.

* Added `GET /version/:version/check` that checks if the given `:version` is supported. For example, `GET /version/2/check` would return a `200`.

* Added `GET /upgrade` endpoint that will manually perform an upgrade. We can add a trigger to call this endpoint on the leader upon join but it's not necessary until `v3` so I figured I'd hold off.

* Removed the `:v2` from the Raft command names so that upgrades from `v1` will not be corrupted.

* Upgraded the `PeerServer` handler to use the Gorilla mux.

/cc: @philips @xiangli-cmu