Repository navigation
feat(lifecycle): validate resource flags and improve runtime prerequisite errors - #122
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
23a00fc to
424f07d
Compare
|
Rebased cleanly onto latest main (d6686fc) and verified commands::up (35/35) and commands::lifecycle unit tests pass. |
424f07d to
0b703fa
Compare
|
Thanks for rebasing onto
|
|
Thanks @zeekay for the detailed review! Both items are resolved in
Verified cleanly with |
7a831e6 to
cda025d
Compare
…site errors Signed-off-by: Trần Hoàng Tú <[email protected]>
cda025d to
d48dc40
Compare
|
Thanks @tranhoangtu-it for aligning the |
Summary
Audits lifecycle resource flags (
--cpus,--memory,--disk/--disk-size,--cloud-only,--vm,--all-workloads) and surfaces actionable prerequisite remediation errors acrosshanzo start,hanzo up,hanzo restart,hanzo down, andhanzo vm.Closes #110
/claim #110
Changes
src/commands/lifecycle/units.rs,src/main.rs,src/commands/lifecycle/resources.rs):parse_cpus(1..=256),parse_memory_mb(>= 256 MiB), andparse_disk_mb(>= 1 GiB / 1024 MiB) with clear boundary error messages and applied them acrossUp,Start,Restart,VmLifecycleCommand::Start, andVmLifecycleCommand::Resize.downscopes (src/main.rs,src/cli_subcommands.rs,src/cli_dispatch.rs):conflicts_with_allbetween--vm,--cloud, and--all-workloadsonhanzo downand alignedhanzo up downto expose the same scope flags.src/commands/vm.rs,src/commands/up.rs,src/commands/up/kube.rs):/dev/kvmchecks acrossx86_64andaarch64(modprobe kvm,usermod -aG kvm $USER && newgrp kvm), added macOSVirtualization.framework/ entitlement preflight checks (check_macos_virtualization_host), invokedvm::preflight_host()before downloading or booting checkpoints inup::upandup::start, added an explicit WSL2/native guidance error forhanzo starton Windows, addedPermissionDeniedremediation when adopting/etc/rancher/k3s/k3s.yaml, and wrapped stale/malformedKubeClient::from_kubeconfigerrors withrm -f ... && hanzo startrecovery commands.src/main_lifecycle_tests.rs,src/commands/lifecycle/tests.rs,src/commands/vm/tests.rs,src/commands/up/tests.rs):--cpus,--memory,--disk,--cloud-only,--vm/--cloud/--all-workloadsconflicts, Linux/macOS virtualization preflight errors, native kubeconfig permission errors, and corrupt/missing kubeconfig remediation.Reproducible Build & Test Output (WSL2 Linux x86_64)