Skip to content

Conversation

@vrothberg
Copy link
Contributor

@vrothberg vrothberg commented Jul 10, 2024

Add a new images command that lists bootc-enabled images in the local store.

Add a new `images` command that lists bootc-enabled images in the local
store.  This is a first step toward working with local images rather
than always pulling them.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
@vrothberg
Copy link
Contributor Author

vrothberg commented Jul 10, 2024

@germag @cgwalters @rhatdan WDYT?

My desired UX is to do a podman-bootc images that only lists bootc-enabled images and then run or convert them. Currently a draft to collect some feedback before going any further.

@vrothberg vrothberg marked this pull request as ready for review July 11, 2024 08:15
@vrothberg
Copy link
Contributor Author

Friendly ping. I can add some e2e test. Shall we expose more flags as podman images does? @cgwalters @germag @rhatdan ?

Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks totally sane to me.

I will say though (and this touches on #61 ) is that it's honestly not clear to me we gain significant value with another implementation of basically just forking off a run of podman images --filter label=containers.bootc=1.

Comment on lines +25 to +26
Short: "List bootc images in the local containers store",
Long: "List bootc images in the local container store",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the difference in plurality?
(Do we actually need to duplicate short/long at all with cobra? In short can't we just have Short:?)

machine, err := utils.GetMachineContext()
if err != nil {
println(utils.PodmanMachineErrorMessage)
logrus.Errorf("failed to connect to podman machine. Is podman machine running?\n%s", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we do this elsewhere in the code but IMO logging and returning errors often leads to unnecessary double printing.

Copy link
Collaborator

@germag germag Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I remembered, that println message is a banner that shows that podman machine should be running

return rpt.Execute(imgs)
}

func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the capital S?

@cgwalters
Copy link
Collaborator

(Will trade my review of this for review of #61 )

@germag
Copy link
Collaborator

germag commented Jul 15, 2024

Overall, this looks totally sane to me.

I will say though (and this touches on #61 ) is that it's honestly not clear to me we gain significant value with another implementation of basically just forking off a run of podman images --filter label=containers.bootc=1.

Yes, it seems that forking podman -r images --filter label=containers.bootc=1 --sort created will be equivalent, besides showing <none>

@vrothberg
Copy link
Contributor Author

Thanks! I will play a bit with calling podman directly. But I probably won't find time before Friday.

@cgwalters
Copy link
Collaborator

We chatted about this and are good with it as is!

@cgwalters cgwalters merged commit 576583b into bootc-dev:main Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants