bug: Make 3.3.0 compatible with netbox-docker-agent >= 1.25 - #248
Merged
Merged
Conversation
The agent writes container state back to NetBox using values read verbatim from the Docker daemon. Four of those values were rejected by the 3.3.0 models, which made every refresh and import fail with HTTP 400. - log_driver: the choice set only allowed `json-log` (not a real Docker driver name) and `syslog`, while the agent sends HostConfig.LogConfig.Type, i.e. `json-file` on a default daemon. The field is now free-form and nullable, and existing `json-log` rows are normalised to `json-file`. - public_port: the agent uses -1 for exposed but unpublished ports; the validator floor moves from 0 to -1. - cap_add: the enumeration only contained NET_ADMIN, while the agent reports the container's real capabilities with the CAP_ prefix stripped. The full Linux capability set is now accepted. - Env.value: raised from 4096 to 32768 characters, since the agent imports environment values verbatim. All changes are widening only: no existing data becomes invalid, and nothing here depends on a NetBox API newer than 4.1. Feature parity with the 5.x line (cmd, sysctls, cap_drop, pid_mode, extra_hosts, secOpt, pause/unpause) is deliberately out of scope.
`0038_alter_port_public_port` clashed with main's `0038_container_cmd`: both depended on `0037_alter_env_value`, so the two branches carried diverging migration graphs. Upgrading a NetBox instance from this branch to a main release left an orphan row in `django_migrations`, and merging the branches gave Django two leaf nodes, which it refuses to load. Backport `0038_container_cmd` and its `Container.cmd` field from main, then renumber the port migration to `1039_alter_port_public_port` with `0038_container_cmd` as its dependency. The migration graph of this branch is now a strict prefix of main's. `Container.cmd` is deliberately left out of the serializers, forms, tables and filtersets here: it exists only to keep the model state and the database schema in sync with main, without backporting the feature itself.
psycopg-c 3.2.3 fails to build against the PostgreSQL 18 headers now shipped by the GitHub runners: PostgreSQL 18 dropped the HAVE_LONG_INT_64 macro that the vendored numutils.c relies on. Swap the `c` extra for `binary` before installing the requirements, so the extension is never compiled. The binary wheel bundles its own libpq and is equivalent for running the test suite.
lvenier
approved these changes
Sep 18, 2026
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The agent writes container state back to NetBox using values read verbatim from the Docker daemon. Four of those values were rejected by the 3.3.0 models, which made every refresh and import fail with HTTP 400.
json-log(not a real Docker driver name) andsyslog, while the agent sends HostConfig.LogConfig.Type, i.e.json-fileon a default daemon. The field is now free-form and nullable, and existingjson-logrows are normalised tojson-file.All changes are widening only: no existing data becomes invalid, and nothing here depends on a NetBox API newer than 4.1.
Feature parity with the 5.x line (cmd, sysctls, cap_drop, pid_mode, extra_hosts, secOpt, pause/unpause) is deliberately out of scope.