konflux-ci / rpm-lockfile-prototype

GNU General Public License v3.0
3 stars 10 forks source link

Fix the first FROM statement detection #38

Closed msrb closed 1 month ago

msrb commented 1 month ago

Break the loop if we found what we were looking for.

lubomir commented 1 month ago

This used to be how the thing worked, until #22 changed it from first stage to the last one. I don't know if there's a good default approach here. Generally you want the stage that is installing RPMs. It may be the first one, or it may be the last one, but I don't think there's a way to always do the right thing.

msrb commented 1 month ago

Hmm, right. The method description is what confused me here:

def extract_image(containerfile):
    """Find image mentioned in the first FROM statement in the containerfile."""

I am wondering if it would make sense to extend varsFromContainerfile to take the image name hint as an input param (without a version)?

varsFromContainerfile: [Containerfile, ubi10/ubi]

WDYT?

lubomir commented 1 month ago

Ah, the docstring wasn't updated.

Some update will be needed to get this working. Other options than image name might be number of the stage or name of the stage.

msrb commented 1 month ago

Ah, the docstring wasn't updated.

I will open a new PR.

Some update will be needed to get this working. Other options than image name might be number of the stage or name of the stage.

I will open an issue for this. And I am closing this PR ;)