Skip to content

Commit cfb3560

Browse files
SongZhen0704sharang
authored andcommitted
[controller] force set vtap type is k8s_vm if exist cluster_id
1 parent 008aec3 commit cfb3560

File tree

1 file changed

+7
-1
lines changed
  • server/controller/trisolaris/services/grpc/synchronize

1 file changed

+7
-1
lines changed

server/controller/trisolaris/services/grpc/synchronize/vtap.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ func (e *VTapEvent) generateConfigInfo(c *vtap.VTapCache, clusterID string) *api
9696
ifMacSource := api.IfMacSource(vtapConfig.IfMacSource)
9797
captureSocketType := api.CaptureSocketType(vtapConfig.CaptureSocketType)
9898
vtapID := uint32(c.GetVTapID())
99-
tridentType := common.TridentType(c.GetVTapType())
99+
100+
tridentType := common.TridentType(0)
101+
if clusterID != "" { // if agent report cluster_id, force set tridentType = VTAP_TYPE_POD_VM
102+
tridentType = common.TridentType(VTAP_TYPE_POD_VM)
103+
} else {
104+
tridentType = common.TridentType(c.GetVTapType())
105+
}
100106
podClusterId := uint32(c.GetPodClusterID())
101107
vpcID := uint32(c.GetVPCID())
102108
tapMode := api.TapMode(vtapConfig.TapMode)

0 commit comments

Comments
 (0)