Skip to content

Commit 989fa73

Browse files
xiaochaoren1SongZhen0704
authored andcommitted
fix: tagrecorder allows sub_domain to be null
1 parent 461dd60 commit 989fa73

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

server/controller/tagrecorder/ch_pod_k8s_label.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ func (c *ChPodK8sLabel) onResourceUpdated(md *message.Metadata, updateMessage *m
7979
})
8080
}
8181
}
82-
if len(keysToDelete) > 0 {
83-
c.SubscriberComponent.dbOperator.delete(keysToDelete, targetsToDelete, db)
84-
}
82+
}
83+
84+
if len(keysToDelete) > 0 {
85+
c.SubscriberComponent.dbOperator.delete(keysToDelete, targetsToDelete, db)
8586
}
8687
}
8788

server/controller/tagrecorder/healer/data_gen.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,12 @@ func (s *dataGeneratorComponent[GT]) generate() error {
335335
} else {
336336
q = q.Where("domain = ?", s.md.GetDomainLcuuid())
337337
if s.filterSubDomain {
338-
q = q.Where("sub_domain = ?", s.md.GetSubDomainLcuuid())
338+
subDomainLcuuid := s.md.GetSubDomainLcuuid()
339+
if subDomainLcuuid != "" {
340+
q = q.Where("sub_domain = ?", subDomainLcuuid)
341+
} else {
342+
q = q.Where("(sub_domain = '' or sub_domain is null)")
343+
}
339344
}
340345
}
341346
return q

0 commit comments

Comments
 (0)