You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the pod is restarted, the pod information in the metric labels will be empty, but the service and workload information are both still there.
Before restarting:
After restarting:
How to reproduce?
This issue can be reproduced by running the following unit test.
When receiving an Update event, we first Delete the corresponding pod and then Add it back. The deleting logic is implemented in a delay mode, which means it will delete the pod from the cache after adding. So we can't find the pod in the end.
How to fix
I will rewrite the logic in the OnUpdate method of pod_watch.go. As we only care about the IP address, port, container ID, and labels of the pod, so I will compare these fields between the old pod and the new one. If they are all identical, I will skip this update event, otherwise, I will update the corresponding fields.
The text was updated successfully, but these errors were encountered:
Right. Then the problem becomes more complicated because we still need to delete the container ID from the cache. I will handle both these cases in the OnUpdate method.
Describe the bug
After the pod is restarted, the pod information in the metric labels will be empty, but the service and workload information are both still there.
Before restarting:
After restarting:
How to reproduce?
This issue can be reproduced by running the following unit test.
Cause
When receiving an
Update
event, we firstDelete
the corresponding pod and thenAdd
it back. The deleting logic is implemented in a delay mode, which means it will delete the pod from the cache after adding. So we can't find the pod in the end.How to fix
I will rewrite the logic in the
OnUpdate
method ofpod_watch.go
. As we only care about the IP address, port, container ID, and labels of the pod, so I will compare these fields between the old pod and the new one. If they are all identical, I will skip this update event, otherwise, I will update the corresponding fields.The text was updated successfully, but these errors were encountered: