Skip to content

Instantly share code, notes, and snippets.

@jkeam
Created October 20, 2024 21:27
Show Gist options
  • Save jkeam/c78307e9a9aa5869060283d1b86d9a5e to your computer and use it in GitHub Desktop.
Save jkeam/c78307e9a9aa5869060283d1b86d9a5e to your computer and use it in GitHub Desktop.
Grabs the additional images required for a given OpenShift release and puts it in a format that can be pasted into an imageset.yaml
from urllib.request import urlopen
from re import sub
def read(version:str) -> None:
with urlopen(f"https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{version}/release.txt") as f:
contents = f.read().decode('utf-8').split('\n')
for content in contents:
if 'quay.io' in content:
line = sub(r"^\s*[\w-]+\s*", "", content)
print(f" - name: {line}")
if __name__ == '__main__':
read('4.16.17')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment