-
Notifications
You must be signed in to change notification settings - Fork 399
Update k8s meta with specific relation type #2224
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
Update k8s meta with specific relation type #2224
Conversation
@@ -241,8 +241,9 @@ func (m *metaCollector) handleAddOrUpdate(event *k8smeta.K8sMetaEvent) { | |||
logs := processor(event.Object, "Update") | |||
for _, log := range logs { | |||
m.send(log, isEntity(event.Object.ResourceType)) | |||
if isEntity(event.Object.ResourceType) && canClusterLinkDirectly(event.Object.ResourceType, m.serviceK8sMeta) { | |||
link := m.generateEntityClusterLink(log) | |||
canClusterLinkDirectly, relationType := canClusterLinkDirectly(event.Object.ResourceType, m.serviceK8sMeta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个变量名和函数名一致了,会覆盖函数变量
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
link := m.generateEntityClusterLink(log) | ||
canClusterLinkDirectly, relationType := canClusterLinkDirectly(event.Object.ResourceType, m.serviceK8sMeta) | ||
if isEntity(event.Object.ResourceType) && canClusterLinkDirectly { | ||
link := m.generateEntityClusterLink(log, relationType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其他地方好像都叫linkType,不叫relationType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -417,8 +419,11 @@ func (m *metaCollector) generateEntityClusterLink(entityEvent models.PipelineEve | |||
log.Contents.Add(entityLinkDestDomainFieldName, m.serviceK8sMeta.domain) | |||
log.Contents.Add(entityLinkDestEntityTypeFieldName, content.Get(entityTypeFieldName)) | |||
log.Contents.Add(entityLinkDestEntityIDFieldName, content.Get(entityIDFieldName)) | |||
|
|||
log.Contents.Add(entityLinkRelationTypeFieldName, "runs") | |||
if relationType != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是不是保留空字符串就行了,其他关系也没配默认值
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Pass relationtype to cluster-entity link by entity type
原 : 对于cluster到Namespace、Node的link的关系类型,默认runs,参数配置没有生效
现 : 基于具体的参数配置(Cluster2Namespace等) 进行关系类型设定