mirror of
https://github.com/CloudNebulaProject/zmgr.git
synced 2026-04-10 13:10:42 +00:00
Refresh architecture, implementation-state, and gap-analysis docs to reflect all DX changes: validate, completions, JSON output, boot/halt, auto-width tables, confirmation flow, progress output, and partial failure handling. Move resolved gaps to the Resolved section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.6 KiB
2.6 KiB
Implementation State
Completed
Core
- Project scaffold (Cargo.toml, module structure)
- KDL v2 parsing helpers (
kdl_util.rs) - Error types with miette diagnostics (
error.rs) - Global config loading (
config.rs) - Template loading + defaults — multi-net support (
template.rs) - IPAM pool loading, allocation, defaults — range + list modes (
pool.rs) - Zone registry CRUD — multi-net support (
zone.rs) - Publisher management (
publisher.rs) - Exec layer for system commands (
exec.rs) - Import logic from existing zones — multi-net parsing (
import.rs) - Validation engine (
validate.rs)
CLI Commands
init,create,destroy,list,status,importboot,halt— thin wrappers around zoneadmvalidate— checks KDL syntax, referential integrity, pool sanity, duplicate IPstemplate list|show,pool list|showpublisher list|add|removecompletions <shell>— bash/zsh/fish shell completions
DX Features
--dry-run/-nflag for create and destroy--yes/-yflag to skip confirmation (scripting)--jsonflag for machine-readable output--versionflag- Destroy confirmation: type zone name to confirm (TTY detection)
- Step-by-step numbered progress during create/destroy
- Partial failure guidance: prints cleanup commands on create failure
- Auto-sizing table columns (measures content before printing)
- Dry-run notes that IP allocation is tentative
- Publisher remove accepts publisher name or filename stem
- Import uses current date + matches template net names
- RFC 5737 comment on default public pool
Multi-Network
- Templates define multiple
netblocks, each referencing a pool - List-based IPAM pools (explicit addresses from hoster)
- Default router template with internal + public nets
- Backward compat: legacy flat
poolfield in templates
Not Yet Tested on illumos
zmgr create(requires zonecfg/zoneadm/dladm)zmgr destroyzmgr importzmgr status(requires zoneadm)zmgr boot/zmgr halt
Dependencies
| Crate | Version | Purpose |
|---|---|---|
| clap | 4.6.0 | CLI parsing (derive) |
| clap_complete | 4.6.0 | Shell completion generation |
| kdl | 6.5.0 | KDL v2 document parsing |
| miette | 7.6.0 | Diagnostic error reporting |
| thiserror | 2.0.18 | Error type derives |
| ipnet | 2.12.0 | IP network arithmetic |
| chrono | 0.4.44 | Date formatting |
| serde | 1.0.228 | Serialization framework |
| serde_json | 1.0.149 | JSON output |