def delete_path(self, path_or_fn, cascade=True):
"""Simple kubectl delete wrapper.
:param path_or_fn: Path or filename of yaml resource descriptions
"""
LOG.info('(-) kubectl delete -f %s', path_or_fn)
try:
self.kubectl.delete(
'-f', path_or_fn,
'--namespace={}'.format(self.config.namespace),
'--context={}'.format(self.config.context),
'--cascade={}'.format('true' if cascade else 'false')
)
except sh.ErrorReturnCode:
return False
return True
评论列表
文章目录