Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1099e96

Browse filesBrowse files
committed
fix(api): replace deprecated attribute in delete_in_bulk()
The `name_regex` attribute has been deprecated in favor of `name_regex_delete`. See: https://gitlab.com/gitlab-org/gitlab/-/commit/ce99813cf54
1 parent a5d8b7f commit 1099e96
Copy full SHA for 1099e96

File tree

Expand file treeCollapse file tree

1 file changed

+13
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-11
lines changed
Open diff view settings
Collapse file

‎gitlab/v4/objects/container_registry.py‎

Copy file name to clipboardExpand all lines: gitlab/v4/objects/container_registry.py
+13-11Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,28 @@ class ProjectRegistryTagManager(DeleteMixin, RetrieveMixin, RESTManager):
3131
_path = "/projects/%(project_id)s/registry/repositories/%(repository_id)s/tags"
3232

3333
@cli.register_custom_action(
34-
"ProjectRegistryTagManager", optional=("name_regex", "keep_n", "older_than")
34+
"ProjectRegistryTagManager",
35+
("name_regex_delete",),
36+
optional=("keep_n", "name_regex_keep", "older_than"),
3537
)
3638
@exc.on_http_error(exc.GitlabDeleteError)
37-
def delete_in_bulk(self, name_regex=".*", **kwargs):
39+
def delete_in_bulk(self, name_regex_delete, **kwargs):
3840
"""Delete Tag in bulk
3941
4042
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-
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)
43+
name_regex_delete (string): The regex of the name to delete. To delete all
44+
tags specify .*.
45+
keep_n (integer): The amount of latest tags of given name to keep.
46+
name_regex_keep (string): The regex of the name to keep. This value
47+
overrides any matches from name_regex.
48+
older_than (string): Tags to delete that are older than the given time,
49+
written in human readable form 1h, 1d, 1month.
50+
**kwargs: Extra options to send to the server (e.g. sudo)
4951
Raises:
5052
GitlabAuthenticationError: If authentication is not correct
5153
GitlabDeleteError: If the server cannot perform the request
5254
"""
5355
valid_attrs = ["keep_n", "name_regex_keep", "older_than"]
54-
data = {"name_regex": name_regex}
56+
data = {"name_regex_delete": name_regex_delete}
5557
data.update({k: v for k, v in kwargs.items() if k in valid_attrs})
5658
self.gitlab.http_delete(self.path, query_data=data, **kwargs)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.