mirror of https://github.com/docker/compose.git
Update gRPC inspect result with HostConfig struct. Breaking changes in inspect API, but this is not used yet in VSCode Docker extension, and still in beta.
(Cf https://github.com/microsoft/vscode-docker/blob/master/src/docker/DockerServeClient/DockerServeUtils.ts) Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
parent
6516632ecf
commit
cfc490fd92
File diff suppressed because it is too large
Load Diff
|
@ -45,14 +45,20 @@ message Container {
|
|||
string command = 4;
|
||||
uint64 cpu_time = 5;
|
||||
uint64 memory_usage = 6;
|
||||
uint64 memory_limit = 7;
|
||||
uint64 pids_current = 8;
|
||||
uint64 pids_limit = 9;
|
||||
repeated string labels = 10;
|
||||
repeated Port ports = 11;
|
||||
uint64 cpu_limit = 12;
|
||||
string platform = 13;
|
||||
string restart_policy_condition = 14;
|
||||
uint64 pids_current = 7;
|
||||
uint64 pids_limit = 8;
|
||||
repeated string labels = 9;
|
||||
repeated Port ports = 10;
|
||||
string platform = 11;
|
||||
HostConfig host_config = 12;
|
||||
}
|
||||
|
||||
message HostConfig {
|
||||
uint64 memory_reservation = 1;
|
||||
uint64 memory_limit = 2;
|
||||
uint64 cpu_reservation = 3;
|
||||
uint64 cpu_limit = 4;
|
||||
string restart_policy = 5;
|
||||
}
|
||||
|
||||
message InspectRequest {
|
||||
|
|
|
@ -122,20 +122,24 @@ func (p *proxy) Logs(request *containersv1.LogsRequest, stream containersv1.Cont
|
|||
|
||||
func toGrpcContainer(c containers.Container) *containersv1.Container {
|
||||
return &containersv1.Container{
|
||||
Id: c.ID,
|
||||
Image: c.Image,
|
||||
Status: c.Status,
|
||||
Command: c.Command,
|
||||
CpuTime: c.CPUTime,
|
||||
MemoryUsage: c.MemoryUsage,
|
||||
MemoryLimit: c.HostConfig.MemoryLimit,
|
||||
Platform: c.Platform,
|
||||
PidsCurrent: c.PidsCurrent,
|
||||
PidsLimit: c.PidsLimit,
|
||||
Labels: c.Config.Labels,
|
||||
Ports: portsToGrpc(c.Ports),
|
||||
CpuLimit: uint64(c.HostConfig.CPULimit),
|
||||
RestartPolicyCondition: c.HostConfig.RestartPolicy,
|
||||
Id: c.ID,
|
||||
Image: c.Image,
|
||||
Status: c.Status,
|
||||
Command: c.Command,
|
||||
CpuTime: c.CPUTime,
|
||||
MemoryUsage: c.MemoryUsage,
|
||||
Platform: c.Platform,
|
||||
PidsCurrent: c.PidsCurrent,
|
||||
PidsLimit: c.PidsLimit,
|
||||
Labels: c.Config.Labels,
|
||||
Ports: portsToGrpc(c.Ports),
|
||||
HostConfig: &containersv1.HostConfig{
|
||||
MemoryReservation: c.HostConfig.MemoryReservation,
|
||||
MemoryLimit: c.HostConfig.MemoryLimit,
|
||||
CpuReservation: uint64(c.HostConfig.CPUReservation),
|
||||
CpuLimit: uint64(c.HostConfig.CPULimit),
|
||||
RestartPolicy: c.HostConfig.RestartPolicy,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue