konflux-ci / rpm-lockfile-prototype

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

Add variable interpolation support for repos #36

Closed msrb closed 1 month ago

msrb commented 1 month ago

Variable interpolation support for repofiles was implemented in https://github.com/konflux-ci/rpm-lockfile-prototype/pull/27. This works, but the need for git credentials seems to be problematic (see: CWFHEALTH-3323).

There is also one (hypothetical) limitation:

Let's consider the following example:

So, to make this work, we would need to maintain the repo file in both ubi and layered-1 repositories.

Proposal

I think that having the variable interpolation option in the repos section could help with both of these problems (credentials + distance from root).

I imagine that it could work like this (just an example, I don't insist on this format):

  repos:
    # List of objects with repoid and baseurl
    - varsFromContainerfile: Containerfile
    - repoid: rhel
      baseurl: https://example.com/rhel/nightly/rhel/{compose-id}/compose/BaseOS/$basearch/os/
   ...

In the base image (ubi), we would create a label compose-id, that would be then inherited to all layered images.

WDYT?

lubomir commented 1 month ago

The use case sounds reasonable to me. #37 has a prototype of this.

I'm not too happy about the way it's specified in the config file. The current version would lead to a lot of duplication if there are multiple repos. And there certainly are going to be multiple repos in most use cases.

msrb commented 1 month ago

Thank you! I will test the MR later today and I will leave a comment with my findings there ;)

msrb commented 1 month ago

Works -- thanks! ;)