From 345cf307c7d3531bb3af3d5e4e78a3321f6b9cb8 Mon Sep 17 00:00:00 2001 From: rashmy Date: Wed, 10 Jul 2019 17:37:54 -0700 Subject: [PATCH] changes --- source/code/plugin/KubernetesApiClient.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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