File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515
1616## [ 0.0.x] ( https://github.com/singularityhub/singularity-hpc/tree/main ) (0.0.x)
17+ - use quay.io api to list tags since does not conform to oci (0.1.28)
1718 - filter out vex and sbom tags (0.1.27)
1819 - unpin yaml dependency (0.1.26)
1920 - Change format of config command output to only show setting values, not keys, for parseability (0.1.25)
Original file line number Diff line number Diff line change @@ -34,13 +34,37 @@ def tags(self):
3434 """
3535 Get image tags.
3636 """
37+ # Quay does not follow the distribution spec, crane only returns 50
38+ if "quay.io" in self .container_name :
39+ return self .tags_quay ()
40+
3741 url = "%s/ls/%s" % (self .apiroot , self .container_name )
3842 response = self .get_request (url )
3943 tags = [x .strip () for x in response .text .split ("\n " ) if x .strip ()]
4044 # Don't include tags for vex or sbom
4145 tags = [x for x in tags if not re .search ("[.](sbom|vex)$" , x )]
4246 return tags
4347
48+ def tags_quay (self ):
49+ """
50+ Custom endpoint to handle quay and pagination.
51+ """
52+ repository = self .container_name .replace ("quay.io/" , "" , 1 )
53+ page = 1
54+ tags = []
55+ has_more = True
56+ while has_more :
57+ url = f"https://quay.io/api/v1/repository/{ repository } /tag/?limit=100&page={ page } "
58+ response = self .get_request (url ).json ()
59+ new_tags = [
60+ x .get ("name" ) for x in response .get ("tags" , {}) if x .get ("name" )
61+ ]
62+ new_tags = [x for x in new_tags if not re .search ("[.](sbom|vex)$" , x )]
63+ tags += new_tags
64+ has_more = response .get ("has_additional" ) is True
65+ page += 1
66+ return tags
67+
4468 def manifest (self , tag ):
4569 url = "%s/manifest/%s:%s" % (self .apiroot , self .container_name , tag )
4670 response = self .get_request (url )
Original file line number Diff line number Diff line change 22__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
33__license__ = "MPL 2.0"
44
5- __version__ = "0.1.27 "
5+ __version__ = "0.1.28 "
66AUTHOR = "Vanessa Sochat"
7788NAME = "singularity-hpc"
You can’t perform that action at this time.
0 commit comments