hawkular / hawkular-openshift-agent

A Hawkular feed that collects metrics from Prometheus and/or Jolokia endpoints deployed in one or more pods within an OpenShift node.
16 stars 21 forks source link

panic with index out of range if endpoint path is empty #115

Closed jmazzitelli closed 7 years ago

jmazzitelli commented 7 years ago

If you have a configmap with an endpoint defined that has an empty Path, you will get a panic.

Workaround - set the path to "/" (since that is what is implied with an empty path - the query string is the root context, hence using "/" for your path is the proper thing to do here).

jmazzitelli commented 7 years ago

I did a quick commit (https://github.com/hawkular/hawkular-openshift-agent/commit/41628934ada2acd8ce9bbfe6d68b8db23f6f2dae) so we check for the string length to avoid the panic. But people should be setting the Path. But since the agent has no control over the config map authors, we shouldn't panic anyway and be able to assume "/".

jmazzitelli commented 7 years ago

see #116 for more. That is probably a duplicate of this issue, but it has the stack trace which I think is the result of this bug.