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:
14
14
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
15
15
16
16
## [ 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)
17
18
- filter out vex and sbom tags (0.1.27)
18
19
- unpin yaml dependency (0.1.26)
19
20
- 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):
34
34
"""
35
35
Get image tags.
36
36
"""
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
+
37
41
url = "%s/ls/%s" % (self .apiroot , self .container_name )
38
42
response = self .get_request (url )
39
43
tags = [x .strip () for x in response .text .split ("\n " ) if x .strip ()]
40
44
# Don't include tags for vex or sbom
41
45
tags = [x for x in tags if not re .search ("[.](sbom|vex)$" , x )]
42
46
return tags
43
47
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
+
44
68
def manifest (self , tag ):
45
69
url = "%s/manifest/%s:%s" % (self .apiroot , self .container_name , tag )
46
70
response = self .get_request (url )
Original file line number Diff line number Diff line change 2
2
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
3
3
__license__ = "MPL 2.0"
4
4
5
- __version__ = "0.1.27 "
5
+ __version__ = "0.1.28 "
6
6
AUTHOR = "Vanessa Sochat"
7
7
8
8
NAME = "singularity-hpc"
You can’t perform that action at this time.
0 commit comments