Phase 3: CLI banger image pull

newImagePullCommand mirrors newImageRegisterCommand with a positional
<oci-ref> arg, the same kernel-ref / direct-paths flag set + mutual
exclusion, plus --size that parses human-friendly values via
model.ParseSize before crossing the RPC boundary.

Calls "image.pull" RPC, prints the resulting image summary on success.
Long help warns about the Phase A bootability gap (ownership not
preserved; suitable as `image build` base, not yet directly bootable).

CLI test confirms image pull is registered with the expected flags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thales Maciel 2026-04-16 17:29:06 -03:00
parent a8c9983542
commit d5f72dfad9
No known key found for this signature in database
GPG key ID: 33112E6833C34679
2 changed files with 84 additions and 0 deletions

View file

@ -59,6 +59,35 @@ func TestVersionCommandPrintsBuildInfo(t *testing.T) {
}
}
func TestImageCommandIncludesPull(t *testing.T) {
cmd := NewBangerCommand()
var image *cobra.Command
for _, sub := range cmd.Commands() {
if sub.Name() == "image" {
image = sub
break
}
}
if image == nil {
t.Fatalf("image command missing from root")
}
hasPull := false
for _, sub := range image.Commands() {
if sub.Name() == "pull" {
hasPull = true
if flag := sub.Flags().Lookup("kernel-ref"); flag == nil {
t.Errorf("image pull missing --kernel-ref flag")
}
if flag := sub.Flags().Lookup("size"); flag == nil {
t.Errorf("image pull missing --size flag")
}
}
}
if !hasPull {
t.Fatalf("image pull subcommand missing")
}
}
func TestKernelCommandExposesSubcommands(t *testing.T) {
cmd := NewBangerCommand()
var kernel *cobra.Command