netobserv / network-observability-cli

An OpenShift / Kubernetes CLI tool for network observability
Apache License 2.0
7 stars 6 forks source link

NETOBSERV-1617: use filter with packets capture feature #54

Closed msherif1234 closed 2 months ago

msherif1234 commented 2 months ago

Description

add filter capability for pca feature Example from running on Kind cluster

NETOBSERV_AGENT_IMAGE=quay.io/netobserv/netobserv-ebpf-agent:f525832 ./build/oc-netobserv packets --protocol="TCP" --port=443

output pcap

tcpdump -r 2024-06-27T110645Z.pcap 
reading from file 2024-06-27T110645Z.pcap, link-type EN10MB (Ethernet), snapshot length 262144
07:06:57.502363 IP 172.18.0.3.41396 > ec2-52-204-93-25.compute-1.amazonaws.com.https: Flags [P.], seq 2078794407:2078794438, ack 1312010586, win 458, options [nop,nop,TS val 3614985982 ecr 3018431589], length 31
07:06:57.502422 IP 172.18.0.3.41396 > ec2-52-204-93-25.compute-1.amazonaws.com.https: Flags [F.], seq 31, ack 1, win 458, options [nop,nop,TS val 3614985982 ecr 3018431589], length 0
07:06:57.531353 IP ec2-52-204-93-25.compute-1.amazonaws.com.https > 172.18.0.3.41396: Flags [.], ack 31, win 114, options [nop,nop,TS val 3018461620 ecr 3614985982], length 0
07:06:57.531372 IP ec2-52-204-93-25.compute-1.amazonaws.com.https > 172.18.0.3.41396: Flags [F.], seq 1, ack 32, win 114, options [nop,nop,TS val 3018461620 ecr 3614985982], length 0
07:06:57.531381 IP 172.18.0.3.41396 > ec2-52-204-93-25.compute-1.amazonaws.com.https: Flags [.], ack 2, win 458, options [nop,nop,TS val 3614986011 ecr 3018461620], length 0
07:06:58.819363 IP 172.18.0.3.37132 > ec2-44-216-66-253.compute-1.amazonaws.com.https: Flags [P.], seq 1277682538:1277682569, ack 1218593254, win 461, options [nop,nop,TS val 1795579274 ecr 783897356], length 31

Dependencies

https://github.com/netobserv/netobserv-ebpf-agent/pull/359

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

openshift-ci-robot commented 2 months ago

@msherif1234: This pull request references NETOBSERV-1617 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set.

In response to [this](https://github.com/netobserv/network-observability-cli/pull/54): >## Description > >add filter capability for pca feature >## Dependencies > >https://github.com/netobserv/netobserv-ebpf-agent/pull/359 > >## Checklist > >If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that. > >* [ ] Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix _(in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes)._ >* [ ] Does this PR require product documentation? > * [ ] If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs. >* [ ] Does this PR require a product release notes entry? > * [ ] If so, fill in "Release Note Text" in the JIRA. >* [ ] Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc. > * [ ] If so, make sure it is described in the JIRA ticket. >* QE requirements (check 1 from the list): > * [ ] Standard QE validation, with pre-merge tests unless stated otherwise. > * [ ] Regression tests only (e.g. refactoring with no user-facing change). > * [ ] No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team). > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=netobserv%2Fnetwork-observability-cli). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 28.99%. Comparing base (88ad0cb) to head (8a46886).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #54 +/- ## ======================================= Coverage 28.99% 28.99% ======================================= Files 8 8 Lines 1045 1045 ======================================= Hits 303 303 Misses 720 720 Partials 22 22 ``` | [Flag](https://app.codecov.io/gh/netobserv/network-observability-cli/pull/54/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/netobserv/network-observability-cli/pull/54/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | `28.99% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#carryforward-flags-in-the-pull-request-comment) to find out more.
openshift-ci-robot commented 2 months ago

@msherif1234: This pull request references NETOBSERV-1617 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set.

In response to [this](https://github.com/netobserv/network-observability-cli/pull/54): >## Description > >add filter capability for pca feature >Example from running on `Kind` cluster >- build commands locally and use agent custom image > >```sh >NETOBSERV_AGENT_IMAGE=quay.io/netobserv/netobserv-ebpf-agent:f525832 ./build/oc-netobserv packets --protocol="TCP" --port=443 >``` > >output pcap >```sh >tcpdump -r 2024-06-27T110645Z.pcap >reading from file 2024-06-27T110645Z.pcap, link-type EN10MB (Ethernet), snapshot length 262144 >07:06:57.502363 IP 172.18.0.3.41396 > ec2-52-204-93-25.compute-1.amazonaws.com.https: Flags [P.], seq 2078794407:2078794438, ack 1312010586, win 458, options [nop,nop,TS val 3614985982 ecr 3018431589], length 31 >07:06:57.502422 IP 172.18.0.3.41396 > ec2-52-204-93-25.compute-1.amazonaws.com.https: Flags [F.], seq 31, ack 1, win 458, options [nop,nop,TS val 3614985982 ecr 3018431589], length 0 >07:06:57.531353 IP ec2-52-204-93-25.compute-1.amazonaws.com.https > 172.18.0.3.41396: Flags [.], ack 31, win 114, options [nop,nop,TS val 3018461620 ecr 3614985982], length 0 >07:06:57.531372 IP ec2-52-204-93-25.compute-1.amazonaws.com.https > 172.18.0.3.41396: Flags [F.], seq 1, ack 32, win 114, options [nop,nop,TS val 3018461620 ecr 3614985982], length 0 >07:06:57.531381 IP 172.18.0.3.41396 > ec2-52-204-93-25.compute-1.amazonaws.com.https: Flags [.], ack 2, win 458, options [nop,nop,TS val 3614986011 ecr 3018461620], length 0 >07:06:58.819363 IP 172.18.0.3.37132 > ec2-44-216-66-253.compute-1.amazonaws.com.https: Flags [P.], seq 1277682538:1277682569, ack 1218593254, win 461, options [nop,nop,TS val 1795579274 ecr 783897356], length 31 > >``` >## Dependencies > >https://github.com/netobserv/netobserv-ebpf-agent/pull/359 > >## Checklist > >If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that. > >* [ ] Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix _(in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes)._ >* [ ] Does this PR require product documentation? > * [ ] If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs. >* [ ] Does this PR require a product release notes entry? > * [ ] If so, fill in "Release Note Text" in the JIRA. >* [ ] Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc. > * [ ] If so, make sure it is described in the JIRA ticket. >* QE requirements (check 1 from the list): > * [ ] Standard QE validation, with pre-merge tests unless stated otherwise. > * [ ] Regression tests only (e.g. refactoring with no user-facing change). > * [ ] No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team). > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=netobserv%2Fnetwork-observability-cli). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
Amoghrd commented 2 months ago

/ok-to-test

github-actions[bot] commented 2 months ago

New image: quay.io/netobserv/network-observability-cli:2fd8052

It will expire after two weeks.

To use this build, update your commands using:

USER=netobserv VERSION=2fd8052 make commands
msherif1234 commented 2 months ago

/retest

openshift-ci[bot] commented 2 months ago

New changes are detected. LGTM label has been removed.

msherif1234 commented 2 months ago

fixed the help strings to match with the new pca fmt for e2e to pass

openshift-ci[bot] commented 2 months ago

New changes are detected. LGTM label has been removed.

openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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: - **[OWNERS](https://github.com/netobserv/network-observability-cli/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
Amoghrd commented 2 months ago

Was this also meant to be no-qe? If not, why was it merged prior to testing?