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

feat: discover virtual network interface #1448

Conversation

AhmedGrati
Copy link

Resolves #1385.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 2, 2023
Copy link

netlify bot commented Nov 2, 2023

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit 6aa6590
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/654cfe6754bd240008b7bf54
😎 Deploy Preview https://deploy-preview-1448--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 2, 2023
@AhmedGrati
Copy link
Author

/cc @marquiz

@marquiz
Copy link
Contributor

marquiz commented Nov 3, 2023

Thanks @AhmedGrati for this enhancement. I will review it in detail in the near future

ping @rwlove

source/network/network.go Outdated Show resolved Hide resolved
source/network/network.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 5, 2023
@rwlove
Copy link

rwlove commented Nov 5, 2023

Would you be able to get the VLAN ID from the interface with this change?

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
@AhmedGrati AhmedGrati force-pushed the feat-discover-virtual-network-interface branch from 76419e9 to 59bd846 Compare November 5, 2023 18:46
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 5, 2023
@AhmedGrati AhmedGrati force-pushed the feat-discover-virtual-network-interface branch from 59bd846 to 50f22ba Compare November 5, 2023 18:50
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 5, 2023
@AhmedGrati
Copy link
Author

@rwlove currently no, but I think we can add it. wdyt @marquiz?

@marquiz
Copy link
Contributor

marquiz commented Nov 6, 2023

@rwlove currently no, but I think we can add it. wdyt @marquiz?

Sure, if it's somehow possible to get that information (in our limited environment). Otherwise you just need to e.g. rely in naming of your interfaces

@AhmedGrati
Copy link
Author

@marquiz We need to add another mount-point which is /proc/net/vlan in order to get the VLAN ID of a specific network interface.

@marquiz
Copy link
Contributor

marquiz commented Nov 6, 2023

We need to add another mount-point which is /proc/net/vlan in order to get the VLAN ID of a specific network interface.

Hmm, I don't like that. Plus reading it needs root?

@AhmedGrati
Copy link
Author

@marquiz reading doesn't require root access.

@AhmedGrati
Copy link
Author

/retest

@AhmedGrati
Copy link
Author

ping @marquiz

@AhmedGrati AhmedGrati force-pushed the feat-discover-virtual-network-interface branch from 50f22ba to c838d08 Compare November 9, 2023 14:05
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
@AhmedGrati AhmedGrati force-pushed the feat-discover-virtual-network-interface branch from c838d08 to 6aa6590 Compare November 9, 2023 15:44
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

From my side this looks ready to get in

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 9, 2023
@marquiz
Copy link
Contributor

marquiz commented Nov 9, 2023

@marquiz reading doesn't require root access.

At least with all the distros I tried (Ubuntu, Fedora, openSUSE) it requires root

$ ls /proc/net/vlan/ -l
total 0
-rw------- 1 root root 0 Nov  9 21:13 config
-rw------- 1 root root 0 Nov  9 21:13 eno2.12

@AhmedGrati
Copy link
Author

@marquiz should you assign the merging to someone?

@marquiz
Copy link
Contributor

marquiz commented Nov 16, 2023

/assign @ArangoGutierrez

@AhmedGrati
Copy link
Author

ping @ArangoGutierrez

1 similar comment
@AhmedGrati
Copy link
Author

ping @ArangoGutierrez

@ArangoGutierrez
Copy link
Contributor

ping @ArangoGutierrez

Sorry I was a bit focused on a new feature, will review this today

Copy link
Contributor

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 5, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e81e6ca2f16bfea86d45dcb2785422e987bf3ec7

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AhmedGrati, ArangoGutierrez, marquiz

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 [ArangoGutierrez,marquiz]

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

Copy link

codecov bot commented Dec 5, 2023

Codecov Report

Merging #1448 (6aa6590) into master (536a006) will increase coverage by 2.80%.
Report is 50 commits behind head on master.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1448      +/-   ##
==========================================
+ Coverage   30.55%   33.35%   +2.80%     
==========================================
  Files          58       58              
  Lines        7527     7956     +429     
==========================================
+ Hits         2300     2654     +354     
- Misses       4978     5021      +43     
- Partials      249      281      +32     
Files Coverage Δ
source/network/network.go 18.30% <0.00%> (-0.81%) ⬇️

... and 5 files with indirect coverage changes

@k8s-ci-robot k8s-ci-robot merged commit 7f859ce into kubernetes-sigs:master Dec 5, 2023
14 checks passed
@marquiz marquiz mentioned this pull request Dec 20, 2023
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discover virtual network interfaces
6 participants