[skip ci]Add comments for custom resource operations (#8468)

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

View File

@ -16,6 +16,7 @@ class CustomResourceOperations(object):
self.plural = kind.lower() self.plural = kind.lower()
def create(self, body): def create(self, body):
"""create or apply a custom resource in k8s"""
pretty = 'true' pretty = 'true'
config.load_kube_config() config.load_kube_config()
api_instance = client.CustomObjectsApi() api_instance = client.CustomObjectsApi()
@ -28,6 +29,7 @@ class CustomResourceOperations(object):
raise Exception(str(e)) raise Exception(str(e))
def delete(self, metadata_name, raise_ex=True): def delete(self, metadata_name, raise_ex=True):
"""delete or uninstall a custom resource in k8s"""
print(metadata_name) print(metadata_name)
try: try:
config.load_kube_config() config.load_kube_config()