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

Generate random kernel interface names #1590

Merged
merged 8 commits into from
Mar 21, 2024

Conversation

NikitaSkrynnik
Copy link
Contributor

@NikitaSkrynnik NikitaSkrynnik commented Mar 12, 2024

Description

Generate random kernel interface names of a form nsm############ where # is a random character.

Issue link

#1589

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionality
  • Documentation
  • Refactoring
  • CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
@NikitaSkrynnik NikitaSkrynnik marked this pull request as draft March 12, 2024 10:59
@NikitaSkrynnik NikitaSkrynnik marked this pull request as ready for review March 12, 2024 11:10
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 73.73737% with 26 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@b1a3e26). Click here to learn what that means.

Files Patch % Lines
pkg/tools/nanoid/generator.go 70.21% 12 Missing and 2 partials ⚠️
.../networkservice/common/mechanisms/kernel/server.go 0.00% 10 Missing ⚠️
.../networkservice/common/mechanisms/kernel/client.go 93.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1590   +/-   ##
=======================================
  Coverage        ?   67.35%           
=======================================
  Files           ?      262           
  Lines           ?    12450           
  Branches        ?        0           
=======================================
  Hits            ?     8386           
  Misses          ?     3540           
  Partials        ?      524           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@denis-tingaikin denis-tingaikin left a comment

Choose a reason for hiding this comment

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

In general, LGTM

Please add more info for folks in the comments about algorithm guarantees. Also, let's do cover warnings from the codecov job.

pkg/tools/nanoid/generator.go Show resolved Hide resolved
pkg/tools/nanoid/generator.go Outdated Show resolved Hide resolved
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
@denis-tingaikin denis-tingaikin merged commit f5e9a5c into networkservicemesh:main Mar 21, 2024
17 checks passed
nsmbot pushed a commit to networkservicemesh/cmd-csi-driver that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-cluster-info-k8s that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-ipam-vl3 that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-map-ip-k8s that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-admission-webhook-k8s that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-dashboard-backend that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-remote-vlan that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Mar 21, 2024
…k@main

PR link: networkservicemesh/sdk#1590

Commit: f5e9a5c
Author: Nikita Skrynnik
Date: 2024-03-21 16:48:16 +0700
Message:
  - Generate random kernel interface names (#1590)
* Generate kernel interface name

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix linter issues + move the generator to tools folder

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* cleanup + fix some tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* rerun CI

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments + add more code coverage with tests

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix golang linter issues

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

* fix review comments

Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
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.

None yet

3 participants