Skip to content

Commit

Permalink
Merge pull request #43 from netboxlabs/develop
Browse files Browse the repository at this point in the history
release 🚚
  • Loading branch information
leoparente authored Dec 26, 2024
2 parents 5fda6e3 + 5011879 commit 6af4f06
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 259 deletions.
5 changes: 4 additions & 1 deletion .github/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ linters:
- gosimple
- bodyclose
- gci
- gofumpt

issues:
exclude-use-default: false
Expand All @@ -34,4 +35,6 @@ linters-settings:
- standard
- default
- prefix(github.com/netboxlabs/orb-discovery)
custom-order: true
custom-order: true
go-fumpt:
extra-rules: true
File renamed without changes.
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Policy

## Reporting a Vulnerability

Please send any suspected vulnerability report to [email protected]
4 changes: 2 additions & 2 deletions device-discovery/device_discovery/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ def translate_interface(

# Convert napalm interface speed from Mbps to Netbox Kbps
speed = int(interface_info.get("speed")) * 1000
if not int32_overflows(speed):
if speed > 0 and not int32_overflows(speed):
interface.speed = speed

mtu = interface_info.get("mtu")
if not int32_overflows(mtu):
if mtu > 0 and not int32_overflows(mtu):
interface.mtu = mtu

return interface
Expand Down
2 changes: 1 addition & 1 deletion device-discovery/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.0.1" # Overwritten during the build process
description = "NetBox Labs, Device Discovery backend for Orb Agent, part of NetBox Discovery"
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE.txt" }
license = { text = "Apache-2.0" }
authors = [
{name = "NetBox Labs", email = "[email protected]" }
]
Expand Down
201 changes: 0 additions & 201 deletions network-discovery/LICENSE.txt

This file was deleted.

4 changes: 4 additions & 0 deletions network-discovery/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ build:
lint:
@golangci-lint run ./... --config ../.github/golangci.yaml

.PHONY: fix-lint
fix-lint:
@golangci-lint run ./... --config ../.github/golangci.yaml --fix

.PHONY: test-coverage
test-coverage:
@mkdir -p .coverage
Expand Down
6 changes: 3 additions & 3 deletions network-discovery/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func main() {
diodeTarget := flag.String("diode-target", "", "diode target (REQUIRED)")
diodeAPIKey := flag.String("diode-api-key", "", "diode api key (REQUIRED)."+
" Environment variables can be used by wrapping them in ${} (e.g. ${MY_API_KEY})")
diodeNamePrefix := flag.String("diode-app-name-prefix", "", "diode producer_app_name prefix")
diodeAppNamePrefix := flag.String("diode-app-name-prefix", "", "diode producer_app_name prefix")
logLevel := flag.String("log-level", "INFO", "log level")
logFormat := flag.String("log-format", "TEXT", "log format")
help := flag.Bool("help", false, "show this help")
Expand All @@ -60,8 +60,8 @@ func main() {
}

producerName := AppName
if *diodeNamePrefix != "" {
producerName = fmt.Sprintf("%s/%s", *diodeNamePrefix, AppName)
if *diodeAppNamePrefix != "" {
producerName = fmt.Sprintf("%s/%s", *diodeAppNamePrefix, AppName)
}

client, err := diode.NewClient(
Expand Down
30 changes: 15 additions & 15 deletions network-discovery/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,48 @@ go 1.23.3
require (
github.com/Ullaakut/nmap/v3 v3.0.4
github.com/gin-gonic/gin v1.10.0
github.com/go-co-op/gocron/v2 v2.12.4
github.com/go-co-op/gocron/v2 v2.14.0
github.com/netboxlabs/diode-sdk-go v0.2.0
github.com/stretchr/testify v1.10.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/bytedance/sonic v1.12.6 // indirect
github.com/bytedance/sonic/loader v0.2.1 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.7 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/go-playground/validator/v10 v10.23.0 // indirect
github.com/goccy/go-json v0.10.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/arch v0.12.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241216192217-9240e9c98484 // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.0 // indirect
)
Loading

0 comments on commit 6af4f06

Please sign in to comment.