Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variable interpolation support for repos #36

Closed
msrb opened this issue Aug 29, 2024 · 3 comments
Closed

Add variable interpolation support for repos #36

msrb opened this issue Aug 29, 2024 · 3 comments

Comments

@msrb
Copy link
Contributor

msrb commented Aug 29, 2024

Variable interpolation support for repofiles was implemented in #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:

  • We have a base image: ubi
  • We have a layered image 1: layered-1
    • We are able to read the repo file from the ubi git repo
  • We have a leaf image that uses layered-1 as the base image: leaf-1
    • git repo of the parent image doesn't have any repo file

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
Copy link
Contributor

lubomir commented Aug 29, 2024

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
Copy link
Contributor Author

msrb commented Aug 29, 2024

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

@msrb
Copy link
Contributor Author

msrb commented Aug 30, 2024

Works -- thanks! ;)

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

No branches or pull requests

2 participants