Put TerminationGracePeriod, DeletionGracePeriod and PreStopHandler to docker labels

This commit is contained in:
Random-Liu
2015-12-29 23:46:52 -08:00
parent cd097e3f86
commit 884dc5c9e5
4 changed files with 212 additions and 42 deletions

View File

@@ -458,8 +458,8 @@ func TestKillContainerInPodWithPreStop(t *testing.T) {
Name: "/k8s_foo_qux_new_1234_42",
Config: &docker.Config{
Labels: map[string]string{
kubernetesPodLabel: string(podString),
kubernetesContainerLabel: "foo",
kubernetesPodLabel: string(podString),
kubernetesContainerNameLabel: "foo",
},
},
},
@@ -1440,11 +1440,7 @@ func TestGetTerminationMessagePath(t *testing.T) {
if err != nil {
t.Fatalf("Unexpected inspect error: %v", err)
}
var containerInfo *labelledContainerInfo
containerInfo, err = getContainerInfoFromLabel(inspectResult.Config.Labels)
if err != nil {
t.Fatalf("Unexpected error when getContainerInfoFromLabel: %v", err)
}
containerInfo := getContainerInfoFromLabel(inspectResult.Config.Labels)
terminationMessagePath := containerInfo.TerminationMessagePath
if terminationMessagePath != containers[0].TerminationMessagePath {
t.Errorf("expected termination message path %s, got %s", containers[0].TerminationMessagePath, terminationMessagePath)