Skip to content

e2e: a list truncated mid-record parses as a valid record in the dataplane capture filters #3660

Closed

Description

Summary

Both record filters in hack/e2e-capture-dataplane.sh, lb_filter_services (line 117 at 605030b) and pod_filter_affected (line 210), select rows by field VALUES and never check the field COUNT, so a list that was cut off mid-record parses as a valid record. Demonstrated with stubs: a Service list truncated in the middle of an IP yields an lb-tenant-db.txt probing ip=192.0.2.5 for a service whose real IP was longer, plus a "reachable, skipped" verdict about an address that does not exist; a pod list truncated mid-record invents a node-<node>.txt for a half-parsed node name.

Why it matters

A truncated list is exactly what a bounded or interrupted read produces, and the capture's whole recent hardening is about making such reads honest. A half-record that parses as a record defeats that from below: the artifact then contains confidently-labelled data about objects that are artifacts of the cut, not of the cluster.

Fix shape

One guard per filter: NF == 7 in lb_filter_services, NF == 6 in pod_filter_affected (the jsonpath emits a fixed field count per record), dropping any row with fewer fields. The cut-off note machinery already added to this script explains WHY a row went missing, so dropping the fragment loses nothing a reader needs.

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    area/testingIssues or PRs related to testing (e2e, bats, unit tests)
    on Aug 8, 2026
  2. lexfrei commented on Sep 23, 2026

    @lexfrei
    ContributorAuthor

    Fixed by #3672. The row filters check the field count and drop cut rows, with bats tests for services, pods and endpoints. A cut inside the last field of a record still passes a field count, as noted in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/testingIssues or PRs related to testing (e2e, bats, unit tests)kind/bugCategorizes issue or PR as related to a bugtriage/not-reproducibleIndicates an issue can not be reproduced as described

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions