Change order kubelet starts containers

This starts ephemeral containers prior to init containers so that
ephemeral containers will still be started when init containers fail to
start.

Also improves tests and comments with review suggestions.
This commit is contained in:
Lee Verberne
2019-08-02 19:33:49 +00:00
parent 7bce18b0ce
commit 906286c743
3 changed files with 25 additions and 19 deletions

View File

@@ -383,10 +383,12 @@ func TestGetContainerSpec(t *testing.T) {
wantContainer: &v1.Container{Name: "debug-container"},
},
} {
gotContainer := GetContainerSpec(tc.havePod, tc.haveName)
if diff := cmp.Diff(tc.wantContainer, gotContainer); diff != "" {
t.Errorf("GetContainerSpec for %q returned diff (-want +got):%v", tc.name, diff)
}
t.Run(tc.name, func(t *testing.T) {
gotContainer := GetContainerSpec(tc.havePod, tc.haveName)
if diff := cmp.Diff(tc.wantContainer, gotContainer); diff != "" {
t.Fatalf("GetContainerSpec for %q returned diff (-want +got):%v", tc.name, diff)
}
})
}
}