diff --git a/source/code/plugin/KubernetesApiClient.rb b/source/code/plugin/KubernetesApiClient.rb index 58a276cfd..4cbf8bb40 100644 --- a/source/code/plugin/KubernetesApiClient.rb +++ b/source/code/plugin/KubernetesApiClient.rb @@ -333,7 +333,11 @@ def getContainerResourceRequestsAndLimits(metricJSON, metricCategory, metricName # instead of the actual poduid. Since this uid is not being surface into the UX # its ok to use this. # Use kubernetes.io/config.hash to be able to correlate with cadvisor data - podUid = pod["metadata"]["annotations"]["kubernetes.io/config.hash"] + if pod["metadata"]["annotations"].nil? + next + else + podUid = pod["metadata"]["annotations"]["kubernetes.io/config.hash"] + end else podUid = pod["metadata"]["uid"] end