Error in K8S ipv6 addresses validation CommonUtilization.valid_chars()
/ VALID_CHARS_RE
#1001
Labels
CommonUtilization.valid_chars()
/ VALID_CHARS_RE
#1001
Description
When running in K8S with ipv6 addresses, client fails with error like
Invalid "kubernetes" data ("kubernetes_service_host"): "fd95:b6e3:daad::1"
Expected Behavior
Agent should accept ipv6 addresses
Troubleshooting or NR Diag results
After looking at code and at environment, I found that K8S injects the following variables:
The error happens in
KubernetesUtilization
class in detection process:Detection https://github.com/newrelic/newrelic-python-agent/blob/main/newrelic/common/utilization.py#L153-L157 consist of fetching the data (reading envvar
KUBERNETES_SERVICE_HOST
) then validating it for correctness, one of the steps https://github.com/newrelic/newrelic-python-agent/blob/main/newrelic/common/utilization.py#L127 is checking valid chars https://github.com/newrelic/newrelic-python-agent/blob/main/newrelic/common/utilization.py#L27 , the agent does not expect:
and failsSteps to Reproduce
Run in K8S with ipv6
Your Environment
EKS with ipv6
Additional context
The text was updated successfully, but these errors were encountered: