Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search for k8s metadata using src_ip when no containerid found #233

Merged

Conversation

dxsup
Copy link
Member

@dxsup dxsup commented Jun 1, 2022

Description

Search for k8s metadata using src_ip when no container_id is found.

Motivation and Context

We have found that the event from the client-side doesn't contain the container id in a very small possibility, in which case we take the src_ip as the key to find its k8s metadata.

Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>
@dxsup dxsup requested a review from NeJan2020 June 1, 2022 08:38
Comment on lines +100 to +104
srcIp := labelMap.GetStringValue(constlabels.SrcIp)
if srcIp == loopbackIp {
labelMap.UpdateAddStringValue(constlabels.SrcNodeIp, p.localNodeIp)
labelMap.UpdateAddStringValue(constlabels.SrcNode, p.localNodeName)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Although The k8s information searched may be incorrect when processing data from the loopback device.

@dxsup dxsup merged commit 1213fab into KindlingProject:main Jun 1, 2022
@dxsup dxsup deleted the feat/search-k8s-metadata-using-srcip branch June 1, 2022 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants