Skip to content

Commit

Permalink
[Tagrecorder] modify ch_resource icon_id update
Browse files Browse the repository at this point in the history
 run automation test(basic) pass
  • Loading branch information
Ericsssss committed Feb 1, 2024
1 parent 7dbcb6b commit 79195f4
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_az.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (a *ChAZ) generateUpdateInfo(oldItem, newItem mysql.ChAZ) (map[string]inter
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if len(updateInfo) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (d *ChDevice) generateUpdateInfo(oldItem, newItem mysql.ChDevice) (map[stri
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if oldItem.UID != newItem.UID {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_gprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (p *ChGProcess) generateUpdateInfo(oldItem, newItem mysql.ChGProcess) (map[
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if oldItem.CHostID != newItem.CHostID {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_l3_epc.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (v *ChVPC) generateUpdateInfo(oldItem, newItem mysql.ChVPC) (map[string]int
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if oldItem.UID != newItem.UID {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (p *ChPod) generateUpdateInfo(oldItem, newItem mysql.ChPod) (map[string]int
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if oldItem.PodClusterID != newItem.PodClusterID {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_pod_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (p *ChPodCluster) generateUpdateInfo(oldItem, newItem mysql.ChPodCluster) (
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if len(updateInfo) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_pod_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (p *ChPodGroup) generateUpdateInfo(oldItem, newItem mysql.ChPodGroup) (map[
if oldItem.PodGroupType != newItem.PodGroupType {
updateInfo["pod_group_type"] = newItem.PodGroupType
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if oldItem.PodClusterID != newItem.PodClusterID {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_pod_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (p *ChPodNode) generateUpdateInfo(oldItem, newItem mysql.ChPodNode) (map[st
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if len(updateInfo) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_pod_ns.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (p *ChPodNamespace) generateUpdateInfo(oldItem, newItem mysql.ChPodNamespac
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if oldItem.PodClusterID != newItem.PodClusterID {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (r *ChRegion) generateUpdateInfo(oldItem, newItem mysql.ChRegion) (map[stri
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if len(updateInfo) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/tagrecorder/ch_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (n *ChNetwork) generateUpdateInfo(oldItem, newItem mysql.ChNetwork) (map[st
if oldItem.Name != newItem.Name {
updateInfo["name"] = newItem.Name
}
if oldItem.IconID != newItem.IconID {
if oldItem.IconID != newItem.IconID && newItem.IconID != 0 {
updateInfo["icon_id"] = newItem.IconID
}
if len(updateInfo) > 0 {
Expand Down

0 comments on commit 79195f4

Please sign in to comment.