Add init container loading to the kubelet

This commit is contained in:
Clayton Coleman
2016-03-28 23:08:54 -04:00
parent 6cc6d29339
commit 205a8b4574
12 changed files with 975 additions and 88 deletions

View File

@@ -57,5 +57,15 @@ func fieldPath(pod *api.Pod, container *api.Container) (string, error) {
}
}
}
for i := range pod.Spec.InitContainers {
here := &pod.Spec.InitContainers[i]
if here.Name == container.Name {
if here.Name == "" {
return fmt.Sprintf("spec.initContainers[%d]", i), nil
} else {
return fmt.Sprintf("spec.initContainers{%s}", here.Name), nil
}
}
}
return "", fmt.Errorf("container %#v not found in pod %#v", container, pod)
}