Ensure pod and manifest always have a UUID

* Fixes implication #2 in docs/identifiers.md
* Replication controller lets the apiserver set the pod ID
This commit is contained in:
Clayton Coleman
2014-06-30 17:44:46 -04:00
parent 31e40e1a68
commit 5896ac14da
6 changed files with 125 additions and 14 deletions

View File

@@ -200,12 +200,22 @@ func TestCreateReplica(t *testing.T) {
podControl.createReplica(controllerSpec)
//expectedPod := Pod{
// Labels: controllerSpec.DesiredState.PodTemplate.Labels,
// DesiredState: controllerSpec.DesiredState.PodTemplate.DesiredState,
//}
// TODO: fix this so that it validates the body.
expectedPod := api.Pod{
JSONBase: api.JSONBase{
Kind: "Pod",
},
Labels: controllerSpec.DesiredState.PodTemplate.Labels,
DesiredState: controllerSpec.DesiredState.PodTemplate.DesiredState,
}
fakeHandler.ValidateRequest(t, makeURL("/pods"), "POST", nil)
actualPod := api.Pod{}
if err := json.Unmarshal([]byte(fakeHandler.RequestBody), &actualPod); err != nil {
t.Errorf("Unexpected error: %#v", err)
}
if !reflect.DeepEqual(expectedPod, actualPod) {
t.Logf("Body: %s", fakeHandler.RequestBody)
t.Errorf("Unexpected mismatch. Expected %#v, Got: %#v", expectedPod, actualPod)
}
}
func TestHandleWatchResponseNotSet(t *testing.T) {