@@ -730,6 +730,7 @@ func handleDockerEvents(event *dockerclient.Event, ec chan error, args ...interf
730
730
731
731
containerTenant := getTenantFromContainerInspect (event .ID , & containerInfo )
732
732
network , ipAddress := getEpNetworkInfoFromContainerInspect (event .ID , & containerInfo )
733
+ container := getContainerFromContainerInspect (event .ID ,& containerInfo )
733
734
if ipAddress != "" {
734
735
//Create provider info
735
736
networkname := strings .Split (network , "/" )[0 ]
@@ -738,7 +739,8 @@ func handleDockerEvents(event *dockerclient.Event, ec chan error, args ...interf
738
739
providerUpdReq .Tenant = containerTenant
739
740
providerUpdReq .Network = networkname
740
741
providerUpdReq .Event = "start"
741
- providerUpdReq .Labels = make (map [string ]string )
742
+ providerUpdReq .Container = container
743
+ providerUpdReq .Labels = make (map [string ]string )
742
744
743
745
for k , v := range labelMap {
744
746
providerUpdReq .Labels [k ] = v
@@ -810,3 +812,14 @@ func getEpNetworkInfoFromContainerInspect(containerID string, containerInfo *typ
810
812
}
811
813
return networkName , IPAddress
812
814
}
815
+
816
+ func getContainerFromContainerInspect (event.ID ,& containerInfo ) string {
817
+ container := ""
818
+ if containerInfo != nil && containerInfo .NetworkSettings != nil {
819
+ for _ , endpoint := range containerInfo .NetworkSettings .Networks {
820
+ container = endpoint .EndpointID
821
+ }
822
+ }
823
+ return container
824
+
825
+ }
0 commit comments