kubecost / kubectl-cost

CLI for determining the cost of Kubernetes workloads
Apache License 2.0
872 stars 55 forks source link

Fix use-proxy, bad port -> string conversion #126

Closed michaelmdresser closed 2 years ago

michaelmdresser commented 2 years ago

What does this PR change?

Calling string() on an int results in a rune, not the expected string. That caused an error like:

Error: failed to query allocation API: failed to proxy get kubecost. err: the server is currently unable to handle the request (get services kubecost-cost-analyzer:⎂); data: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"no endpoints available for service \"kubecost-cost-analyzer:⎂\"","reason":"ServiceUnavailable","code":503}

Note the port after kubecost-cost-analyzer:

After this commit, use-proxy works correctly.

How does this PR impact users? (This is the kind of thing that goes in release notes!)

Fixes a regression in v0.2.9 where --use-proxy stopped working.

How was this PR tested?

Manually. Observed use-proxy working after the change.