Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindContainerStatusByName should find non-exited container #82559

Open
wants to merge 1 commit into
base: master
from

Conversation

@tedyu
Copy link
Contributor

commented Sep 11, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
As #82512 reported, when there are multiple ContainerStatus'es with same container name, FindContainerStatusByName should find non-exited container status.

This is option #1 from potential solutions.

Which issue(s) this PR fixes:
Fixes #82512

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tedyu
To complete the pull request process, please assign yujuhong
You can assign the PR to them by writing /assign @yujuhong in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

@tedyu: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-bazel-test 243840e link /test pull-kubernetes-bazel-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

containerStatRet = containerStatus
} else if containerStatRet.State == ContainerStateExited {
containerStatRet = containerStatus
}

This comment has been minimized.

Copy link
@sofat1989

sofat1989 Sep 11, 2019

I think you can use one if here. Maybe it is like this

if containerStatRet == nil || containerStatus.State != ContainerStateExited {
				containerStatRet = containerStatus
			}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.