[skip ci]Add comments in custom resource opt (#8544)

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
pull/8569/head
yanliang567 2021-09-26 12:52:24 +08:00 committed by GitHub
parent e4e762f2e8
commit 4c9929d0c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -43,6 +43,7 @@ class CustomResourceOperations(object):
raise Exception(str(e))
def list_all(self):
"""list all the customer resources in k8s"""
try:
config.load_kube_config()
api_instance = client.CustomObjectsApi()
@ -54,6 +55,7 @@ class CustomResourceOperations(object):
return data
def delete_all(self):
"""delete all the customer resources in k8s"""
cus_objects = self.list_all()
if len(cus_objects["items"]) > 0:
for item in cus_objects["items"]: