mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 05:01:46 +00:00
v1beta3 Pod refactor
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
@@ -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))
|
||||
|
Reference in New Issue
Block a user