Skip to content

Commit 13115bd

Browse files
authored
feat: remove ingestion logs view (#58)
* chore: remove reconciler sdk Signed-off-by: Michal Fiedorowicz <[email protected]> * fix: docker setup with netbox 4.1.11 for netbox-branching plugin Signed-off-by: Michal Fiedorowicz <[email protected]> * feat: remove ingestion logs view Signed-off-by: Michal Fiedorowicz <[email protected]> * chore: update CODEOWNERS Signed-off-by: Michal Fiedorowicz <[email protected]> --------- Signed-off-by: Michal Fiedorowicz <[email protected]>
1 parent 89adbae commit 13115bd

33 files changed

+11
-3185
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @leoparente @mfiedorowicz
1+
* @leoparente @ltucker @mfiedorowicz

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ docker-compose-netbox-plugin-test:
1919

2020
.PHONY: docker-compose-netbox-plugin-test-cover
2121
docker-compose-netbox-plugin-test-cover:
22-
-@$(DOCKER_COMPOSE) -f docker/docker-compose.yaml -f docker/docker-compose.test.yaml run --rm -u root -e COVERAGE_FILE=/opt/netbox/netbox/coverage/.coverage netbox sh -c "coverage run --source=netbox_diode_plugin --omit=*_pb2*,*/migrations/* ./manage.py test --keepdb netbox_diode_plugin && coverage xml -o /opt/netbox/netbox/coverage/report.xml && coverage report -m | tee /opt/netbox/netbox/coverage/report.txt"
22+
-@$(DOCKER_COMPOSE) -f docker/docker-compose.yaml -f docker/docker-compose.test.yaml run --rm -u root -e COVERAGE_FILE=/opt/netbox/netbox/coverage/.coverage netbox sh -c "coverage run --source=netbox_diode_plugin --omit=*/migrations/* ./manage.py test --keepdb netbox_diode_plugin && coverage xml -o /opt/netbox/netbox/coverage/report.xml && coverage report -m | tee /opt/netbox/netbox/coverage/report.txt"
2323
@$(MAKE) docker-compose-netbox-plugin-down

docker/Dockerfile-diode-netbox-plugin

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM netboxcommunity/netbox:v4.1-3.0.1
1+
FROM netboxcommunity/netbox:v4.1.11-3.0.2
22

33
COPY ./netbox/configuration/ /etc/netbox/config/
44
RUN chmod 755 /etc/netbox/config/* && \

docker/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: diode-netbox-plugin
22
services:
33
netbox: &netbox
4-
image: netboxcommunity/netbox:v4.1-3.0.1-diode-netbox-plugin
4+
image: netboxcommunity/netbox:v4.1.11-3.0.2-diode-netbox-plugin
55
build:
66
context: .
77
dockerfile: Dockerfile-diode-netbox-plugin

netbox_diode_plugin/models.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# !/usr/bin/env python
22
# Copyright 2024 NetBox Labs Inc
33
"""Diode NetBox Plugin - Models."""
4+
from urllib.parse import urlparse
45

56
from django.core.exceptions import ValidationError
67
from django.db import models
78
from django.urls import reverse
89
from netbox.models import NetBoxModel
910

10-
from netbox_diode_plugin.reconciler.sdk.client import parse_target
11-
1211

1312
def diode_target_validator(target):
1413
"""Diode target validator."""
1514
try:
16-
_, _, _ = parse_target(target)
15+
parsed_target = urlparse(target)
16+
17+
if parsed_target.scheme not in ["grpc", "grpcs"]:
18+
raise ValueError("target should start with grpc:// or grpcs://")
1719
except ValueError as exc:
1820
raise ValidationError(exc)
1921

netbox_diode_plugin/navigation.py

-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
from netbox.plugins import PluginMenu, PluginMenuItem
66

7-
ingestion_logs = {
8-
"link": "plugins:netbox_diode_plugin:ingestion_logs",
9-
"link_text": "Ingestion Logs",
10-
"staff_only": True,
11-
}
12-
137
settings = {
148
"link": "plugins:netbox_diode_plugin:settings",
159
"link_text": "Settings",
@@ -23,7 +17,6 @@
2317
(
2418
"Diode",
2519
(
26-
PluginMenuItem(**ingestion_logs),
2720
PluginMenuItem(**settings),
2821
),
2922
),

netbox_diode_plugin/reconciler/__init__.py

-3
This file was deleted.

netbox_diode_plugin/reconciler/sdk/__init__.py

-3
This file was deleted.

netbox_diode_plugin/reconciler/sdk/client.py

-256
This file was deleted.

netbox_diode_plugin/reconciler/sdk/exceptions.py

-33
This file was deleted.

netbox_diode_plugin/reconciler/sdk/v1/__init__.py

-3
This file was deleted.

netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2.py

-217
This file was deleted.

0 commit comments

Comments
 (0)