Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions server/controller/tagrecorder/ch_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,18 @@ func (c *ChPodServiceDevice) sourceToTarget(md *message.Metadata, source *mysql.
SubDomainID: md.SubDomainID,
})

// service
keys = append(keys, DeviceKey{DeviceType: CH_DEVICE_TYPE_SERVICE,
DeviceID: source.ID})
targets = append(targets, mysql.ChDevice{
DeviceType: CH_DEVICE_TYPE_SERVICE,
DeviceID: source.ID,
Name: sourceName,
IconID: iconID,
TeamID: md.TeamID,
DomainID: md.DomainID,
SubDomainID: md.SubDomainID,
})
return
}

Expand Down
28 changes: 28 additions & 0 deletions server/controller/tagrecorder/check/ch_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,20 @@ func (d *ChDevice) generatePodServiceData(keyToItem map[DeviceKey]mysql.ChDevice
SubDomainID: tagrecorder.SubDomainToSubDomainID[podService.SubDomain],
}

// service
serviceKey := DeviceKey{
DeviceType: CH_DEVICE_TYPE_SERVICE,
DeviceID: podService.ID,
}
keyToItem[serviceKey] = mysql.ChDevice{
DeviceType: CH_DEVICE_TYPE_SERVICE,
DeviceID: podService.ID,
Name: podService.Name + " (deleted)",
IconID: d.resourceTypeToIconID[IconKey{NodeType: RESOURCE_TYPE_POD_SERVICE}],
TeamID: teamID,
DomainID: tagrecorder.DomainToDomainID[podService.Domain],
SubDomainID: tagrecorder.SubDomainToSubDomainID[podService.SubDomain],
}
} else {
// pod_service
podServiceKey := DeviceKey{
Expand All @@ -477,6 +491,20 @@ func (d *ChDevice) generatePodServiceData(keyToItem map[DeviceKey]mysql.ChDevice
SubDomainID: tagrecorder.SubDomainToSubDomainID[podService.SubDomain],
}

// service
serviceKey := DeviceKey{
DeviceType: CH_DEVICE_TYPE_SERVICE,
DeviceID: podService.ID,
}
keyToItem[serviceKey] = mysql.ChDevice{
DeviceType: CH_DEVICE_TYPE_SERVICE,
DeviceID: podService.ID,
Name: podService.Name,
IconID: d.resourceTypeToIconID[IconKey{NodeType: RESOURCE_TYPE_POD_SERVICE}],
TeamID: tagrecorder.DomainToTeamID[podService.Domain],
DomainID: tagrecorder.DomainToDomainID[podService.Domain],
SubDomainID: tagrecorder.SubDomainToSubDomainID[podService.SubDomain],
}
}
}
return true
Expand Down
1 change: 0 additions & 1 deletion server/querier/engine/clickhouse/tag/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ var AutoServiceMap = map[string]int{
"daemon_set": VIF_DEVICE_TYPE_POD_GROUP_DAEMON_SET,
"replica_set_controller": VIF_DEVICE_TYPE_POD_GROUP_REPLICASET_CONTROLLER,
"clone_set": VIF_DEVICE_TYPE_POD_GROUP_CLONESET,
"service": VIF_DEVICE_TYPE_SERVICE,
}

var PodGroupTypeSlice = []string{
Expand Down