def _update_secret(namespace, name, data, apiserver_url):
 url = '{0}/api/v1/namespaces/{1}/secrets/{2}'.format(apiserver_url, namespace, name)
 data = [{'op': 'replace', 'path': '/data', 'value': data}]
 ret = _kpatch(url, data)
 if (ret.get('status') == 404):
  return "Node {0} doesn't exist".format(url)
 return ret

def _update_secret ( namespace , name , data , apiserver_url ) : url = '{0}/api/v1/namespaces/{1}/secrets/{2}' . format ( apiserver_url , namespace , name ) data = [ { 'op' : 'replace' , 'path' : '/data' , 'value' : data } ] ret = _kpatch ( url , data ) if ( ret . get ( 'status' ) == 404 ) : return "Node {0} doesn't exist" . format ( url ) return ret
replace secrets data by a new one .