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 1dcc077

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 b8a47ba commit 1dcc077
Copy full SHA for 1dcc077

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+12
-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
+12-11Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,27 @@ 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+
optional=("name_regex_delete", "keep_n", "older_than"),
3536
)
3637
@exc.on_http_error(exc.GitlabDeleteError)
37-
def delete_in_bulk(self, name_regex=".*", **kwargs):
38+
def delete_in_bulk(self, name_regex_delete=".*", **kwargs):
3839
"""Delete Tag in bulk
3940
4041
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)
42+
name_regex_delete (string): The regex of the name to delete. To delete all
43+
tags specify .*.
44+
keep_n (integer): The amount of latest tags of given name to keep.
45+
name_regex_keep (string): The regex of the name to keep. This value
46+
overrides any matches from name_regex.
47+
older_than (string): Tags to delete that are older than the given time,
48+
written in human readable form 1h, 1d, 1month.
49+
**kwargs: Extra options to send to the server (e.g. sudo)
4950
Raises:
5051
GitlabAuthenticationError: If authentication is not correct
5152
GitlabDeleteError: If the server cannot perform the request
5253
"""
5354
valid_attrs = ["keep_n", "name_regex_keep", "older_than"]
54-
data = {"name_regex": name_regex}
55+
data = {"name_regex_delete": name_regex_delete}
5556
data.update({k: v for k, v in kwargs.items() if k in valid_attrs})
5657
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.