v1beta3 Pod refactor

This commit is contained in:
markturansky
2014-11-13 10:52:13 -05:00
parent df0981bc01
commit 8af4ccb111
36 changed files with 569 additions and 573 deletions

View File

@@ -62,7 +62,7 @@ func (r RealPodControl) createReplica(namespace string, controller api.Replicati
Labels: desiredLabels,
},
}
if err := api.Scheme.Convert(&controller.Spec.Template.Spec, &pod.DesiredState.Manifest); err != nil {
if err := api.Scheme.Convert(&controller.Spec.Template.Spec, &pod.Spec); err != nil {
glog.Errorf("Unable to convert pod template: %v", err)
return
}
@@ -143,8 +143,8 @@ func (rm *ReplicationManager) watchControllers(resourceVersion *string) {
func (rm *ReplicationManager) filterActivePods(pods []api.Pod) []api.Pod {
var result []api.Pod
for _, value := range pods {
if api.PodSucceeded != value.CurrentState.Status &&
api.PodFailed != value.CurrentState.Status {
if api.PodSucceeded != value.Status.Condition &&
api.PodFailed != value.Status.Condition {
result = append(result, value)
}
}

View File

@@ -219,9 +219,7 @@ func TestCreateReplica(t *testing.T) {
ObjectMeta: api.ObjectMeta{
Labels: controllerSpec.Spec.Template.Labels,
},
DesiredState: api.PodState{
Manifest: manifest,
},
Spec: controllerSpec.Spec.Template.Spec,
}
fakeHandler.ValidateRequest(t, makeURL("/pods?namespace=default"), "POST", nil)
actualPod, err := client.Codec.Decode([]byte(fakeHandler.RequestBody))