Make ResourceVersion a string internally instead of uint64

Allows us to define different watch versioning regimes in the future
as well as to encode information with the resource version.

This changes /watch/resources?resourceVersion=3 to start the watch at
4 instead of 3, which means clients can read a resource version and
then send it back to the server. Clients should no longer do math on
resource versions.
This commit is contained in:
Clayton Coleman
2014-10-07 16:51:28 -04:00
parent 31e02b882b
commit 82bcdd3b3b
54 changed files with 518 additions and 240 deletions

View File

@@ -265,7 +265,7 @@ func TestCreatePod(t *testing.T) {
func TestUpdatePod(t *testing.T) {
requestPod := &api.Pod{
TypeMeta: api.TypeMeta{ID: "foo", ResourceVersion: 1},
TypeMeta: api.TypeMeta{ID: "foo", ResourceVersion: "1"},
CurrentState: api.PodState{
Status: "Foobar",
},
@@ -330,7 +330,7 @@ func TestGetController(t *testing.T) {
func TestUpdateController(t *testing.T) {
requestController := &api.ReplicationController{
TypeMeta: api.TypeMeta{ID: "foo", ResourceVersion: 1},
TypeMeta: api.TypeMeta{ID: "foo", ResourceVersion: "1"},
}
c := &testClient{
Request: testRequest{Method: "PUT", Path: "/replicationControllers/foo"},
@@ -464,7 +464,7 @@ func TestCreateService(t *testing.T) {
}
func TestUpdateService(t *testing.T) {
svc := &api.Service{TypeMeta: api.TypeMeta{ID: "service-1", ResourceVersion: 1}}
svc := &api.Service{TypeMeta: api.TypeMeta{ID: "service-1", ResourceVersion: "1"}}
c := &testClient{
Request: testRequest{Method: "PUT", Path: "/services/service-1", Body: svc},
Response: Response{StatusCode: 200, Body: svc},