Skip to content

Commit

Permalink
fix wrong url when clearing cache stats (istio#3985)
Browse files Browse the repository at this point in the history
* fix wrong url when clearing cache stats

* prefix http:// to pilot_url if the entered url doesn't start with it.
  • Loading branch information
baodongli authored and mandarjog committed Mar 6, 2018
1 parent 80e65b5 commit 16272d6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/istio-proxy-cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def query(self, path, post=False):
print url
try:
if post:
return requests.post(url, headers=self.headers).json()
return requests.post(url, headers=self.headers)
else:
return requests.get(url, headers=self.headers).json()
except Exception as ex:
Expand Down Expand Up @@ -128,7 +128,7 @@ def cache_stats(self):
return self.query("/cache_stats")

def clear_cache_stats(self):
return self.query("/clear_cache_stats", post=True)
return self.query("/cache_stats_delete", post=True)

# Class XDS end

Expand Down Expand Up @@ -294,7 +294,10 @@ def main(args):
if not args.skip_pilot:
pilot_url = args.pilot_url
pilot_port_forward_pid = ""
if not pilot_url:
if pilot_url:
if not pilot_url.startswith("http://") and not pilot_url.startswith("https://"):
pilot_url = "http://" + pilot_url
else:
pilot_url, pilot_port_forward_pid = find_pilot_url()

output_file = output_dir + "/" + "pilot_xds.json"
Expand Down

0 comments on commit 16272d6

Please sign in to comment.