Skip to content

Commit dd0f1e8

Browse files
authored
Merge pull request #132 from netboxlabs/revert-131-develop
Revert "Release"
2 parents 5317145 + cfcf906 commit dd0f1e8

34 files changed

+581
-1064
lines changed

.github/golangci.yaml

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
1-
version: "2"
21
run:
2+
timeout: 5m
33
modules-download-mode: readonly
4+
5+
output:
6+
formats: colored-line-number
7+
48
linters:
59
enable:
6-
- bodyclose
710
- revive
8-
exclusions:
9-
generated: lax
10-
rules:
11-
- linters:
12-
- revive
13-
path: /*.go
14-
text: 'package-comments: should have a package comment'
15-
paths:
16-
- third_party$
17-
- builtin$
18-
- examples$
19-
severity:
20-
default: error
21-
formatters:
22-
enable:
11+
- errcheck
12+
- unused
13+
- staticcheck
14+
- ineffassign
15+
- govet
16+
- gosimple
17+
- bodyclose
2318
- gci
2419
- gofumpt
25-
settings:
26-
gci:
27-
sections:
28-
- standard
29-
- default
30-
- prefix(github.com/netboxlabs/orb-agent)
31-
custom-order: true
32-
exclusions:
33-
generated: lax
34-
paths:
35-
- third_party$
36-
- builtin$
37-
- examples$
20+
21+
issues:
22+
exclude-use-default: false
23+
exclude-rules:
24+
- path: /*.go
25+
text: "package-comments: should have a package comment"
26+
linters:
27+
- revive
28+
29+
severity:
30+
default-severity: error
31+
32+
linters-settings:
33+
gci:
34+
sections:
35+
- standard
36+
- default
37+
- prefix(github.com/netboxlabs/orb-agent)
38+
custom-order: true
39+
go-fumpt:
40+
extra-rules: true

.github/workflows/develop.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
contents: write
1313

1414
env:
15-
GO_VERSION: '1.24'
15+
GO_VERSION: '1.23'
1616

1717
jobs:
1818
build-and-push:

.github/workflows/lint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
- name: Setup Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: '1.24.x'
20+
go-version: '1.23.x'
2121
check-latest: true
2222
- name: Lint
23-
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 #v8.0.0
23+
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 #v6.1.1
2424
with:
25-
version: v2.1.6
25+
version: v1.62
2626
working-directory: .
2727
args: --config .github/golangci.yaml

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
env:
1616
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717
SEMANTIC_RELEASE_PACKAGE: ${{ github.repository }}
18-
GO_VERSION: '1.24'
18+
GO_VERSION: '1.23'
1919
APP_NAME: orb-agent
2020

2121
permissions:

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Setup Go
3535
uses: actions/setup-go@v5
3636
with:
37-
go-version: '1.24.x'
37+
go-version: '1.23.x'
3838
check-latest: true
3939
- name: Run go build
4040
run: go build ./...

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
diode/
2-
orb-configs/
31
build/
4-
.coverage/
2+
.vscode/
3+
.coverage/

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
include agent/docker/.env
2+
3+
# expects to be set as env var
14
PRODUCTION_AGENT_REF_TAG ?= latest
25
PRODUCTION_AGENT_DEBUG_REF_TAG ?= latest-debug
36
REF_TAG ?= develop
47
DEBUG_REF_TAG ?= develop-debug
58
PKTVISOR_TAG ?= develop
69
PKTVISOR_DEBUG_TAG ?= develop-debug
7-
SNMP_DISCOVERY_TAG ?= latest
810
DOCKERHUB_REPO = netboxlabs
911
ORB_DOCKERHUB_REPO = netboxlabs
1012
BUILD_DIR = build
@@ -37,9 +39,6 @@ endif
3739
install-dev-tools:
3840
@go install github.com/mfridman/tparse@latest
3941

40-
.PHONY: deps
41-
deps:
42-
@go mod tidy
4342

4443
agent_bin:
4544
echo "ORB_VERSION: $(ORB_VERSION)-$(COMMIT_HASH)"
@@ -64,7 +63,6 @@ agent:
6463
docker build --no-cache \
6564
--build-arg GOARCH=$(GOARCH) \
6665
--build-arg PKTVISOR_TAG=$(PKTVISOR_TAG) \
67-
--build-arg SNMP_DISCOVERY_TAG=$(SNMP_DISCOVERY_TAG) \
6866
--tag=$(ORB_DOCKERHUB_REPO)/orb-agent:$(REF_TAG) \
6967
--tag=$(ORB_DOCKERHUB_REPO)/orb-agent:$(ORB_VERSION) \
7068
--tag=$(ORB_DOCKERHUB_REPO)/orb-agent:$(ORB_VERSION)-$(COMMIT_HASH) \
@@ -97,4 +95,4 @@ pull-latest-otel-collector-contrib:
9795
cp ./agent/backend/otel/otelcol-contrib .
9896
rm ./agent/backend/otel/otelcol_contrib.tar.gz
9997
rm ./agent/backend/otel/LICENSE
100-
rm ./agent/backend/otel/README.md
98+
rm ./agent/backend/otel/README.md

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ orb:
6060
network_discovery:
6161
...
6262
```
63-
Only the `network_discovery`, `device_discovery`, `worker` and `snmp_discovery` backends are currently supported. They do not require any special configuration.
63+
Only the `network_discovery`, `device_discovery` and `worker` backends are currently supported. They do not require any special configuration.
6464
- [Device Discovery](./docs/backends/device_discovery.md)
6565
- [Network Discovery](./docs/backends/network_discovery.md)
6666
- [Worker](./docs/backends/worker.md)
67-
- [SNMP Discovery](./docs/backends/snmp_discovery.md)
6867

6968
#### Common
7069
A special `common` subsection under `backends` defines configuration settings that are shared with all backends. Currently, it supports passing [diode](https://github.com/netboxlabs/diode) server settings to all backends.
@@ -96,9 +95,6 @@ orb:
9695
worker:
9796
worker_policy_1:
9897
# see docs/backends/worker.md
99-
snmp_discovery:
100-
snmp_policy_1:
101-
# see docs/backends/snmp.md
10298
```
10399

104100
## Running the agent

agent/backend/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ func (c *CmdWrapper) Status() CmdStatus {
8181

8282
// GetStdout returns the stdout channel
8383
func (c *CmdWrapper) GetStdout() <-chan string {
84-
return c.Stdout
84+
return c.Cmd.Stdout
8585
}
8686

8787
// GetStderr returns the stderr channel
8888
func (c *CmdWrapper) GetStderr() <-chan string {
89-
return c.Stderr
89+
return c.Cmd.Stderr
9090
}

agent/backend/devicediscovery/device_discovery.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ type deviceDiscoveryBackend struct {
4343
diodeClientID string
4444
diodeClientSecret string
4545
diodeAppNamePrefix string
46-
diodeOtelEndpoint string
4746

4847
startTime time.Time
4948
proc backend.Commander
@@ -85,12 +84,6 @@ func (d *deviceDiscoveryBackend) Configure(logger *slog.Logger, repo policies.Po
8584
d.diodeClientSecret = common.Diode.ClientSecret
8685
d.diodeAppNamePrefix = common.Diode.AgentName
8786

88-
if common.Otel.Grpc != "" {
89-
d.diodeOtelEndpoint = common.Otel.Grpc
90-
d.logger.Info("device-discovery using OTLP metrics endpoint",
91-
slog.String("endpoint", d.diodeOtelEndpoint))
92-
}
93-
9487
return nil
9588
}
9689

@@ -119,10 +112,6 @@ func (d *deviceDiscoveryBackend) Start(ctx context.Context, cancelFunc context.C
119112
"--diode-app-name-prefix", d.diodeAppNamePrefix,
120113
}
121114

122-
if d.diodeOtelEndpoint != "" {
123-
pvOptions = append(pvOptions, "--otel-endpoint", d.diodeOtelEndpoint)
124-
}
125-
126115
d.logger.Info("device-discovery startup", slog.Any("arguments", pvOptions))
127116

128117
pvOptions[9] = d.diodeClientSecret

0 commit comments

Comments
 (0)