Use buildah commit for podman commit#592
Conversation
|
@TomSweeneyRedHat @rhatdan @mheon Again, this will eventually fix the two issues Ed has filed against podman. I know we have issues with this approach; but the problem is we have no consensus on another approach. So review and we can decide if this is a good stop gap or you want me to implement a larger, agreed upon approach. |
cmd/podman/commit.go
Outdated
There was a problem hiding this comment.
Separate from the Buildah stuff, but I really don't like this... can we just pass in a string for the name of the new image?
There was a problem hiding this comment.
We can give return a *image.Image from commit so we still get a good image to work with
cmd/podman/commit.go
Outdated
There was a problem hiding this comment.
This API would be a lot cleaner if we used functional options, but we can clean it up later
There was a problem hiding this comment.
Yes I agree we should have a image.Config object
There was a problem hiding this comment.
I think you guys are talking about two different things ... I think @mheon is talking about "WithWriter" funcs? Either would be fine by me if preferred. The previous one used a struct.
libpod/container_api.go
Outdated
There was a problem hiding this comment.
I'd like to figure out how much code ImportBuilder actually is - how much code from buildah do we really need to bring in for this? Is this a case where it's just a single file, like when we vendored in Kube stuff?
There was a problem hiding this comment.
I'll certainly look. I was trying to avoid duplication at all costs, but if it is really small, agree that might make more sense.
|
I don't like the image API changes, it seems to me it would make a lot more sense to continue returning an Image and just accept the name/reference for the new image. |
|
Otherwise... I don't like vendoring buildah here, but commit is clearly broken right now and this fixes it. When we consider basing buildah on libpod we can look into factoring the commit code into here. |
|
I think a lot of this code should be added to the image object, At least have a image.Config that defines all of the the fields that can get added to an image. |
|
I was thinking we'd make Commit accept options like NewContainer does, so we can only override what we want to - we'd have a WithEntrypoint, WithCmd, WithAuthor, etc, and pass whatever we wanted into commit itself to only modify those fields. |
|
When I think of commit, I think of container not image logically. What do you guys think ? |
|
On 04/04/2018 09:08 AM, Brent Baude wrote:
When I think of commit, I think of container not image logically. What
do you guys think ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#592 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYbWBQrnOVH8_l24t1tgxVaFdb3Qv7d0ks5tlMXbgaJpZM4TF9IK>.
I personally think transmorgification. Container into an image. But
that's probably due to too many hours reading Calvin and Hobbes.
t
|
|
Those fields are image data fields. So I think the data belongs to the image even if it is temporarily stored in the container. |
|
There's no reason we can't have a struct with the image configuration which is populated by With... functions. Can we work with that using the vendored buildah code, though? Buildah uses setter functions to modify individual bits of the config, which is part of why I like With... functions (easy to translate into the buildah api). Can we ignore the buildah functions and change the image's config after we make it with |
|
☔ The latest upstream changes (presumably fdcf633) made this pull request unmergeable. Please resolve the merge conflicts. |
357e064 to
a132774
Compare
|
@baude Can you hit the manpages and usage text to say that image name is mandatory now? |
libpod/container_commit.go
Outdated
There was a problem hiding this comment.
Does the container need to be mounted to do this?
There was a problem hiding this comment.
I dont know. How can I tell?
There was a problem hiding this comment.
Does commit on a stopped container work? If it does, we should be fine
cmd/podman/commit.go
Outdated
cmd/podman/commit.go
Outdated
libpod/buildah/buildah.go
Outdated
There was a problem hiding this comment.
Did we patch this? Should we have patched this? I'm wondering if this will affect the containers buildah sees
There was a problem hiding this comment.
i changed it if that is what you are asking
fc8191c to
a3e139b
Compare
libpod/image/image.go
Outdated
There was a problem hiding this comment.
Can this and ToStorageReference go away now that we aren't using it?
Resolves: containers#586 and containers#520 Signed-off-by: baude <bbaude@redhat.com>
|
LGTM |
libpod/image/image.go
Outdated
There was a problem hiding this comment.
Horrid Name, No idea what this function does
There was a problem hiding this comment.
Changes LGTM. My questions/concerns is keeping this code up to date with anything that changes in Buildah and/or converting Buildah to use this code. Thoughts on that?
@nalind WDYT?
|
@TomSweeneyRedHat consider this a pilot and stop gap to fix current issues filed against podman. Once this PR is merged, I am ready to start the moving of buildah code over so we no longer have a maintenance issue. |
|
📌 Commit e2b071a has been approved by |
|
⚡ Test exempted: merge already tested. |
Resolves: #586 and #520
Signed-off-by: baude bbaude@redhat.com