fix golint issues in pkg/kubelet/container
This commit is contained in:
@@ -48,14 +48,14 @@ func (p podSandboxByCreated) Len() int { return len(p) }
|
||||
func (p podSandboxByCreated) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
|
||||
func (p podSandboxByCreated) Less(i, j int) bool { return p[i].CreatedAt > p[j].CreatedAt }
|
||||
|
||||
type containerStatusByCreated []*kubecontainer.ContainerStatus
|
||||
type containerStatusByCreated []*kubecontainer.Status
|
||||
|
||||
func (c containerStatusByCreated) Len() int { return len(c) }
|
||||
func (c containerStatusByCreated) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
|
||||
func (c containerStatusByCreated) Less(i, j int) bool { return c[i].CreatedAt.After(c[j].CreatedAt) }
|
||||
|
||||
// toKubeContainerState converts runtimeapi.ContainerState to kubecontainer.ContainerState.
|
||||
func toKubeContainerState(state runtimeapi.ContainerState) kubecontainer.ContainerState {
|
||||
// toKubeContainerState converts runtimeapi.ContainerState to kubecontainer.State.
|
||||
func toKubeContainerState(state runtimeapi.ContainerState) kubecontainer.State {
|
||||
switch state {
|
||||
case runtimeapi.ContainerState_CONTAINER_CREATED:
|
||||
return kubecontainer.ContainerStateCreated
|
||||
@@ -141,7 +141,7 @@ func (m *kubeGenericRuntimeManager) getImageUser(image string) (*int64, string,
|
||||
|
||||
// isInitContainerFailed returns true if container has exited and exitcode is not zero
|
||||
// or is in unknown state.
|
||||
func isInitContainerFailed(status *kubecontainer.ContainerStatus) bool {
|
||||
func isInitContainerFailed(status *kubecontainer.Status) bool {
|
||||
if status.State == kubecontainer.ContainerStateExited && status.ExitCode != 0 {
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user