Remove dead method

Seems like remove_annotations() method in K8sClient is not used anymore,
it was probably only useful in data migrations code that is gone now.

Change-Id: I30dd81d289164fa3c5931222691cd627341b25c6
This commit is contained in:
Michał Dulko 2022-03-31 17:55:27 +02:00
parent 84f6a8bacc
commit efbc24d14d

View File

@ -226,26 +226,6 @@ class K8sClient(object):
self._raise_from_response(response)
return response.json().get('status')
def _jsonpatch_escape(self, value):
value = value.replace('~', '~0')
value = value.replace('/', '~1')
return value
def remove_annotations(self, path, annotation_name):
LOG.debug("Remove annotations %(path)s: %(name)s",
{'path': path, 'name': annotation_name})
content_type = 'application/json-patch+json'
url, header = self._get_url_and_header(path, content_type)
annotation_name = self._jsonpatch_escape(annotation_name)
data = [{'op': 'remove',
'path': f'/metadata/annotations/{annotation_name}'}]
response = self.session.patch(url, data=jsonutils.dumps(data),
headers=header)
if response.ok:
return response.json().get('status')
raise exc.K8sClientException(response.text)
def post(self, path, body):
LOG.debug("Post %(path)s: %(body)s", {'path': path, 'body': body})
url = self._base_url + path