mirror of
https://github.com/prometheus/prometheus
synced 2024-12-25 07:52:28 +00:00
Fix type usage in Kubernetes discovery
The event types have been recently changed to be exported types which wasn't reflected in the new pod discovery.
This commit is contained in:
parent
4c439b4b45
commit
0c6ed9d437
@ -802,14 +802,14 @@ func (kd *Discovery) updatePod(pod *Pod, eventType EventType) {
|
||||
defer kd.podsMu.Unlock()
|
||||
|
||||
switch eventType {
|
||||
case deleted:
|
||||
case Deleted:
|
||||
if _, ok := kd.pods[pod.ObjectMeta.Namespace]; ok {
|
||||
delete(kd.pods[pod.ObjectMeta.Namespace], pod.ObjectMeta.Name)
|
||||
if len(kd.pods[pod.ObjectMeta.Namespace]) == 0 {
|
||||
delete(kd.pods, pod.ObjectMeta.Namespace)
|
||||
}
|
||||
}
|
||||
case added, modified:
|
||||
case Added, Modified:
|
||||
if _, ok := kd.pods[pod.ObjectMeta.Namespace]; !ok {
|
||||
kd.pods[pod.ObjectMeta.Namespace] = map[string]*Pod{}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user