@@ -130,6 +130,21 @@ func (p *proxy) Logs(request *containersv1.LogsRequest, stream containersv1.Cont
130130}
131131
132132func toGrpcContainer (c containers.Container ) * containersv1.Container {
133+ var hostConfig * containersv1.HostConfig
134+ if c .HostConfig != nil {
135+ hostConfig = & containersv1.HostConfig {
136+ MemoryReservation : c .HostConfig .MemoryReservation ,
137+ MemoryLimit : c .HostConfig .MemoryLimit ,
138+ CpuReservation : uint64 (c .HostConfig .CPUReservation ),
139+ CpuLimit : uint64 (c .HostConfig .CPULimit ),
140+ RestartPolicy : c .HostConfig .RestartPolicy ,
141+ AutoRemove : c .HostConfig .AutoRemove ,
142+ }
143+ }
144+ var labels []string
145+ if c .Config != nil {
146+ labels = c .Config .Labels
147+ }
133148 return & containersv1.Container {
134149 Id : c .ID ,
135150 Image : c .Image ,
@@ -140,16 +155,9 @@ func toGrpcContainer(c containers.Container) *containersv1.Container {
140155 Platform : c .Platform ,
141156 PidsCurrent : c .PidsCurrent ,
142157 PidsLimit : c .PidsLimit ,
143- Labels : c . Config . Labels ,
158+ Labels : labels ,
144159 Ports : portsToGrpc (c .Ports ),
145- HostConfig : & containersv1.HostConfig {
146- MemoryReservation : c .HostConfig .MemoryReservation ,
147- MemoryLimit : c .HostConfig .MemoryLimit ,
148- CpuReservation : uint64 (c .HostConfig .CPUReservation ),
149- CpuLimit : uint64 (c .HostConfig .CPULimit ),
150- RestartPolicy : c .HostConfig .RestartPolicy ,
151- AutoRemove : c .HostConfig .AutoRemove ,
152- },
160+ HostConfig : hostConfig ,
153161 Healthcheck : & containersv1.Healthcheck {
154162 Disable : c .Healthcheck .Disable ,
155163 Test : c .Healthcheck .Test ,
0 commit comments