Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ def filename_to_distro_config(
- Dockerfile.rhelXX → rhel-XX-x86_64.yaml
- Dockerfile.cXXs → centos-stream-XX-x86_64.yaml
- Dockerfile.fedora → the newest fedora-XX-x86_64.yaml
- Dockerfile.fXX → the selected fedora-XX-x86_64.yaml

If not found, empty string is returned indicating that the
combination of distro and version is not included
in distgen configuration (multispec).
"""
rhel_match = re.match(r".*\.rhel(\d+)$", filename)
centos_stream_match = re.match(r".*\.c(\d+)s$", filename)
fedora_match = re.match(r".*\.f(\d+)$", filename)

if rhel_match:
config = f"rhel-{rhel_match.group(1)}-x86_64.yaml"
Expand All @@ -96,9 +98,11 @@ def filename_to_distro_config(
config = sorted_configs[0]
else:
config = ""
elif fedora_match: # just for base and core images
config = f"fedora-{fedora_match.group(1)}-x86_64.yaml"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
else:
raise RuntimeError(
f"File {filename} does not match any of the known suffixes: .rhelXX, .cXs, or .fedora"
f"File {filename} does not match any of the known suffixes: .rhelXX, .cXs, .fedora, or .fXX"
)

return config
Expand Down