Skip to content

Commit e49ff3f

Browse files
committed
feat(api): add name_regex_keep attribute in delete_in_bulk()
1 parent 330d69c commit e49ff3f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

gitlab/v4/objects/container_registry.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@ def delete_in_bulk(self, name_regex=".*", **kwargs):
3838
"""Delete Tag in bulk
3939
4040
Args:
41-
name_regex (string): The regex of the name to delete. To delete all
42-
tags specify .*.
43-
keep_n (integer): The amount of latest tags of given name to keep.
44-
older_than (string): Tags to delete that are older than the given time,
45-
written in human readable form 1h, 1d, 1month.
46-
**kwargs: Extra options to send to the server (e.g. sudo)
41+
name_regex (string): The regex of the name to delete. To delete all
42+
tags specify .*.
43+
keep_n (integer): The amount of latest tags of given name to keep.
44+
name_regex_keep (string): The regex of the name to keep. This value
45+
overrides any matches from name_regex.
46+
older_than (string): Tags to delete that are older than the given time,
47+
written in human readable form 1h, 1d, 1month.
48+
**kwargs: Extra options to send to the server (e.g. sudo)
4749
Raises:
4850
GitlabAuthenticationError: If authentication is not correct
4951
GitlabDeleteError: If the server cannot perform the request
5052
"""
51-
valid_attrs = ["keep_n", "older_than"]
53+
valid_attrs = ["keep_n", "name_regex_keep", "older_than"]
5254
data = {"name_regex": name_regex}
5355
data.update({k: v for k, v in kwargs.items() if k in valid_attrs})
5456
self.gitlab.http_delete(self.path, query_data=data, **kwargs)

0 commit comments

Comments
 (0)