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

e2e: Debug logging should be visible in multus pod flake #678

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

zeeke
Copy link
Member

@zeeke zeeke commented Apr 9, 2024

Use Pod.Status.StartTime field to infer the timestamp lower bound of interested log lines. This field is populated by the kubelet, so it uses the same clock as the
multus pod logs.

Prior to this commit, Meta.CreationTimestamp field was used. That field is populated
by the API server, which can have a different clock than the kubelet, as they are likely
to run on different nodes.

Following example comes from a CI run:

{
    "metadata": {
        "name": "testpod-68rc4",
        "generateName": "testpod-",
        "namespace": "sriov-conformance-testing",
        "creationTimestamp": "2024-04-08T10:44:45Z",
        ...
    "status": {
        ...
        "startTime": "2024-04-08T10:44:44Z",
    }
  • logs contains the line of interest starts at 2024-04-08T10:44:44Z:
time="2024-04-08T06:44:44.789882383-04:00" level="debug" msg="function called" cniName="sriov-cni" containerID="d40a5557bef2d29674db595b0b17cb87cb65ca183f00ad4c3a2db86c815c48bc" netns="/var/run/netns/1c9eeef2-a4ee-4dbc-8708-8671976fc579" ifname="net1" func="cmdAdd" args.Path="/opt/cni/bin" args.StdinData="{\"cniVersion\":\"0.3.1\",\"deviceID\":\"0000:15:11.0\",\"ipam\":{\"dataDir\":\"/run/my-orchestrator/container-ipam-state\",\"ranges\":[[{\"subnet\":\"1.1.1.0/24\"}]],\"type\":\"host-local\"},\"logLevel\":\"debug\",\"name\":\"test-log-level-debug-no-file\",\"pciBusID\":\"0000:15:11.0\",\"type\":\"sriov\",\"vlan\":0,\"vlanQoS\":0}" args.Args="IgnoreUnknown=true;K8S_POD_NAMESPACE=sriov-conformance-testing;K8S_POD_NAME=testpod-68rc4;K8S_POD_INFRA_CONTAINER_ID=d40a5557bef2d29674db595b0b17cb87cb65ca183f00ad4c3a2db86c815c48bc;K8S_POD_UID=d9e76ec1-e97c-4bef-bfad-59792ea926d3"

Use `Pod.Status.StartTime` field to infer the timestamp lower bound of interested log lines. This field is populated by the kubelet, so it uses the same clock as the
multus pod logs.

Prior to this commit, `Meta.CreationTimestamp` field was used. That field is populated
by the API server, which can have a different clock than the kubelet, as they are likely
to run on different nodes.

Following example comes from a CI run:
```
{
    "metadata": {
        "name": "testpod-68rc4",
        "generateName": "testpod-",
        "namespace": "sriov-conformance-testing",
        "creationTimestamp": "2024-04-08T10:44:45Z",
        ...
    "status": {
        ...
        "startTime": "2024-04-08T10:44:44Z",
    }
```

Signed-off-by: Andrea Panattoni <[email protected]>
Copy link

github-actions bot commented Apr 9, 2024

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8612554667

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 38.362%

Files with Coverage Reduction New Missed Lines %
controllers/generic_network_controller.go 5 74.53%
Totals Coverage Status
Change from base Build 8605771976: -0.04%
Covered Lines: 4801
Relevant Lines: 12515

💛 - Coveralls

Copy link
Collaborator

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zeeke !

@SchSeba
Copy link
Collaborator

SchSeba commented Apr 11, 2024

@Eoghan1232 @e0ne please take a look for this quick fix

Copy link
Collaborator

@ykulazhenkov ykulazhenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ykulazhenkov merging this one

@SchSeba SchSeba merged commit 359bb79 into k8snetworkplumbingwg:master Apr 16, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants