diff --git a/pkg/kubelet/kuberuntime/helpers.go b/pkg/kubelet/kuberuntime/helpers.go index 9887fd68ce6..d31d0cf479e 100644 --- a/pkg/kubelet/kuberuntime/helpers.go +++ b/pkg/kubelet/kuberuntime/helpers.go @@ -142,7 +142,7 @@ func (m *kubeGenericRuntimeManager) getImageUser(image string) (*int64, string, // isInitContainerFailed returns true under the following conditions: // 1. container has exited and exitcode is not zero. // 2. container in unknown state. -// 3. container occurs OOMKilled. +// 3. container gets OOMKilled. func isInitContainerFailed(status *kubecontainer.Status) bool { // When oomkilled occurs, init container should be considered as a failure. if status.Reason == "OOMKilled" { diff --git a/pkg/kubelet/kuberuntime/helpers_test.go b/pkg/kubelet/kuberuntime/helpers_test.go index 7344460640c..596a258d362 100644 --- a/pkg/kubelet/kuberuntime/helpers_test.go +++ b/pkg/kubelet/kuberuntime/helpers_test.go @@ -51,14 +51,14 @@ func TestIsInitContainerFailed(t *testing.T) { ExitCode: 1, }, isFailed: true, - description: "Init container which state is exited and exitcode is non-zero shoud return true", + description: "Init container which in exited state and non-zero exit code should return true", }, { status: &kubecontainer.Status{ State: kubecontainer.ContainerStateUnknown, }, isFailed: true, - description: "Init container which state is unknown should return true", + description: "Init container which in unknown state should return true", }, { status: &kubecontainer.Status{ @@ -66,7 +66,7 @@ func TestIsInitContainerFailed(t *testing.T) { ExitCode: 0, }, isFailed: true, - description: "Init container which reason is OOMKilled shoud return true", + description: "Init container which reason is OOMKilled should return true", }, { status: &kubecontainer.Status{ @@ -74,21 +74,21 @@ func TestIsInitContainerFailed(t *testing.T) { ExitCode: 0, }, isFailed: false, - description: "Init container which state is exited and exitcode is zero shoud return false", + description: "Init container which in exited state and zero exit code should return false", }, { status: &kubecontainer.Status{ State: kubecontainer.ContainerStateRunning, }, isFailed: false, - description: "Init container which state is running should return false", + description: "Init container which in running state should return false", }, { status: &kubecontainer.Status{ State: kubecontainer.ContainerStateCreated, }, isFailed: false, - description: "Init container which state is created should return false", + description: "Init container which in created state should return false", }, } for i, test := range tests {