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:
parent
a8c9983542
commit
d5f72dfad9
2 changed files with 84 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue