Add spec-aware subnet checks to netengine doctor#148
Merged
Conversation
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.
Motivation
netengine doctorto be run against a world spec to includespec.substrate.networks[*].subnetin preflight network checks.Description
--spec PATHoption and an optional positionalspecargument to thedoctorcommand innetengine/cli/doctor.py, with mutual-exclusion handling and spec-loading via the existing spec loader.DoctorContextand the preflight API (build_context,run_checks) innetengine/diagnostic/preflight.pyto carryspec_subnets: tuple[str, ...]through preflight probes._check_docker_subnet_conflictsto collect compose-defined subnets and also includectx.spec_subnets, to detect overlaps and exact reuse and to emit clearer conflict messages and remediation hints referencing Docker network names.netengine/cli/main.pysoreadinessuses the loaded spec's substrate subnets for subnet checks.README.md,docs/alpha-quickstart.md, anddocs/troubleshooting.mdwith examples likepoetry run netengine doctor --spec examples/minimal.yaml.tests/test_doctor.pycovering--spechandling and Docker subnet conflict detection against spec subnets, and formatted/linted modified files.Testing
python -m pytest tests/test_doctor.pyand all tests passed (15 passed).python -m ruff checkon modified files and linting completed with no issues (All checks passed).git diff --checkto verify no whitespace/git-diff problems and none were reported.Codex Task