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
Fix GetPodLogs failures in NetworkPolicy e2e tests #85897
Conversation
Hi @tnqn. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @danwinship |
/ok-to-test |
oh wait, do they even get run in e2e-gce? |
I think they don't run in CI, because I also found a failing test case, regardless of which CNI is enabled. I'm about to file an issue for that one. |
@danwinship I have create issue #85908 for the failing test I mentioned, also created PR #85909 to fix it, could you also take a look when you are available? Thanks for reviewing! Since the tests are not running in K8s CI, do you have suggestions on how I can prove the PRs are working correctly? I have my own e2e logs, not sure if it helps. |
/retest |
1 similar comment
/retest |
oh, I know, you can just remove the |
f89f1a8
to
c9f085d
Compare
Thanks a lot @danwinship! Following your suggestion, I reproduced the pod log collection failure by enabling test
With this PR, pod log can be collected correctly, see https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/85897/pull-kubernetes-e2e-kind/1216656351183245313:
|
c9f085d
to
e801779
Compare
GetPodLogs always fails when the tests fail, which is because the tests specify wrong container names when getting logs. When creating a client Pod, it specifies "<podName>-container" as container name and "<podName>-" as Pod GenerateName. For instance, podName "client-a" will result in "client-a-container" as the container name and "client-a-vx5sv" as the actual Pod name, but it always uses the actual Pod name to construct the container name when getting logs, e.g. "client-a-vx5sv-container". This patch fixes it by specifying the same static container name when creating Pod and getting logs.
/retest |
1 similar comment
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, tnqn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
GetPodLogs always fails when the tests fail, which is because the tests specify wrong container names when getting logs.
When creating a client Pod, it specifies
<podName>-container
as container name and<podName>-
as Pod GenerateName. For instance, podNameclient-a
will result inclient-a-container
as the container name andclient-a-vx5sv
as the actual Pod name, but it always uses the actual Pod name to construct the container name when getting logs, e.g.client-a-vx5sv-container
.This patch fixes it by specifying the same static container name when creating Pod and getting logs.
Which issue(s) this PR fixes:
Fixes #85896
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: