-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: record service instance which is unbound and recycle later #1775
base: main
Are you sure you want to change the base?
feat: record service instance which is unbound and recycle later #1775
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还需要添加单测
@@ -165,8 +172,21 @@ def provision(self): | |||
).inc() | |||
|
|||
def recycle_resource(self): | |||
if self.db_obj.service.prefer_async_delete: | |||
self.mark_unbound() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
解绑过程需要加逻辑 而不是在回收逻辑里面
你需要先在开发者中心试一下解绑服务是由那个接口或者入口触发的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
由这个接口触发,
DELETE make_app_pattern(f"/services/{SERVICE_UUID}/$", include_envs=False),
,会触发 ModuleCleaner.delete_services(),传入 service_id。 删除module时也会解绑增强服务,也会触发ModuleCleaner.delete_services(),不传service_id。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
远程增强服务也需要有 self.db_obj.service.prefer_async_delete
类似的判断逻辑
apiserver/paasng/paasng/accessories/servicehub/local/manager.py
Outdated
Show resolved
Hide resolved
@@ -279,6 +285,7 @@ def sync_instance_config(self): | |||
def recycle_resource(self): | |||
"""对于 remote service 我们默认其已经具备了回收的能力""" | |||
if self.is_provisioned(): | |||
self.mark_unbound() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
) | ||
unbound_instance.recycle_instance() | ||
|
||
return Response() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要添加单测
No description provided.