-
Couldn't load subscription status.
- Fork 4
Open
Description
Dependency Update Plan
This issue tracks a comprehensive update of dependencies across both the operator and CLI components of Netchecks.
Current Status
Operator Dependencies
- Currently on Pydantic v1.10.x
- Several packages need major version updates
- Some dependencies removed/replaced (deprecated, wrapt)
CLI Dependencies
- Using
uvfor dependency management - Needs similar update sweep
Phased Approach
Phase 1: Operator - Compatible Updates (CURRENT)
Goal: Update to latest compatible versions without breaking changes
Updates completed:
- ✅ kopf: 1.37.1 → 1.38.0
- ✅ kubernetes: 29.0.0 → 34.1.0
- ✅ rich: 13.x → 14.x
- ✅ structlog: 23.x → 25.4.0
- ✅ prometheus-client: 0.16.0 → 0.23.1
- ✅ opentelemetry-*: 1.24/1.25 → 1.37.0
- ✅ ruff: 0.3.x → 0.14.0
- ✅ pytest: 8.1.x → 8.4.x
- ⏳ Kept pydantic at 1.10.24 (not breaking 2.x yet)
Testing Required:
- Unit tests pass
- Integration tests pass in kind cluster
- Existing NetworkAssertions still work
- PolicyReports generated correctly
Phase 2: Pydantic 2.x Migration (Operator)
Goal: Migrate to Pydantic 2.x with breaking changes
Impact Analysis:
Files using Pydantic:
operator/netchecks_operator/config.py- UsesBaseSettings, nested confignetcheck/checks/http.py- UsesBaseModel
Breaking Changes in Pydantic 2.x:
BaseSettingsmoved topydantic-settingspackageConfiginner class →model_configattributecustomise_sources→settings_customise_sourcesenv_nested_delimiter→ nested model automatically parsed.json()→.model_dump_json().dict()→.model_dump()
Migration Tasks:
- Add
pydantic-settingsdependency - Update
operator/netchecks_operator/config.py:- Change
from pydantic import BaseSettings→from pydantic_settings import BaseSettings - Convert
Configinner class tomodel_config - Update
customise_sourcestosettings_customise_sources
- Change
- Update
netcheck/checks/http.pyif using deprecated APIs - Search for
.json()calls → replace with.model_dump_json() - Search for
.dict()calls → replace with.model_dump() - Run full test suite
- Update CLAUDE.md if migration notes needed
Phase 3: CLI Dependencies
Goal: Update netcheck CLI dependencies with uv
Current versions to update:
- Check all outdated packages with
uv - Similar pydantic 2.x migration needed for
netcheck/checks/http.py - Update all test dependencies
- Verify CLI commands still work
Testing Required:
-
uv run pytestpasses - CLI commands work:
netcheck dns,netcheck http,netcheck run - Docker image builds successfully
- CEL validation still works
Phase 4: Final Integration Testing
Goal: Verify entire stack works with all updates
- Build both Docker images with updated dependencies
- Deploy to kind cluster
- Run full integration test suite
- Test all example NetworkAssertions
- Verify PolicyReports generated correctly
- Check operator metrics/telemetry still work
- Performance testing (if needed)
Breaking Change Considerations
For Users
- Operator image tag will change
- Helm chart may need values.yaml updates
- No CRD schema changes expected
Internal
- Config loading mechanism may need adjustment
- Environment variable parsing with nested models
- JSON serialization calls need updating
Rollback Plan
If Phase 2+ causes issues:
- Revert pyproject.toml changes
- Run
poetry install --syncoruv sync --frozen - Rebuild Docker images from previous commit
- Keep Phase 1 updates (safe and tested)
Related Issues
- None yet
Notes
- Phase 1 is conservative - no breaking API changes
- Phase 2 requires careful testing due to Pydantic 2.x breaking changes
- Consider creating feature branch for Phase 2+
- Document any migration issues in CLAUDE.md
Checklist
- Phase 1: Compatible updates
- Phase 1: Testing complete
- Phase 2: Pydantic 2.x migration
- Phase 2: Testing complete
- Phase 3: CLI updates
- Phase 3: Testing complete
- Phase 4: Full integration testing
- Update CLAUDE.md with any migration notes
- Update README if needed
Metadata
Metadata
Assignees
Labels
No labels