mirror of
https://github.com/moby/moby.git
synced 2026-08-06 16:11:48 +00:00
Merge pull request #52053 from thaJeztah/simplify_inspect
daemon: Daemon.getInspectData: unify platform-specific fields
This commit is contained in:
@@ -137,22 +137,23 @@ func (daemon *Daemon) getInspectData(daemonCfg *config.Config, ctr *container.Co
|
||||
FinishedAt: ctr.State.FinishedAt.Format(time.RFC3339Nano),
|
||||
Health: containerHealth,
|
||||
},
|
||||
Image: ctr.ImageID.String(),
|
||||
LogPath: ctr.LogPath,
|
||||
Name: ctr.Name,
|
||||
RestartCount: ctr.RestartCount,
|
||||
Driver: ctr.Driver,
|
||||
Platform: ctr.ImagePlatform.OS,
|
||||
MountLabel: ctr.MountLabel,
|
||||
ProcessLabel: ctr.ProcessLabel,
|
||||
ExecIDs: ctr.GetExecIDs(),
|
||||
HostConfig: &hostConfig,
|
||||
Config: ctr.Config,
|
||||
Image: ctr.ImageID.String(),
|
||||
ResolvConfPath: ctr.ResolvConfPath, // Only used on Linux.
|
||||
HostnamePath: ctr.HostnamePath, // Only used on Linux.
|
||||
HostsPath: ctr.HostsPath, // Only used on Linux.
|
||||
LogPath: ctr.LogPath,
|
||||
Name: ctr.Name,
|
||||
RestartCount: ctr.RestartCount,
|
||||
Driver: ctr.Driver,
|
||||
Platform: ctr.ImagePlatform.OS,
|
||||
MountLabel: ctr.MountLabel, // Only used on Linux.
|
||||
ProcessLabel: ctr.ProcessLabel, // Only used on Linux.
|
||||
AppArmorProfile: ctr.AppArmorProfile, // Only used on Linux.
|
||||
ExecIDs: ctr.GetExecIDs(),
|
||||
HostConfig: &hostConfig,
|
||||
Config: ctr.Config,
|
||||
}
|
||||
|
||||
// Now set any platform-specific fields
|
||||
inspectResponse = setPlatformSpecificContainerFields(ctr, inspectResponse)
|
||||
|
||||
if daemon.UsesSnapshotter() {
|
||||
inspectResponse.Storage = &storage.Storage{
|
||||
RootFS: &storage.RootFSStorage{
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"github.com/moby/moby/api/types/container"
|
||||
containerpkg "github.com/moby/moby/v2/daemon/container"
|
||||
)
|
||||
|
||||
// This sets platform-specific fields
|
||||
func setPlatformSpecificContainerFields(ctr *containerpkg.Container, resp *container.InspectResponse) *container.InspectResponse {
|
||||
resp.AppArmorProfile = ctr.AppArmorProfile
|
||||
resp.ResolvConfPath = ctr.ResolvConfPath
|
||||
resp.HostnamePath = ctr.HostnamePath
|
||||
resp.HostsPath = ctr.HostsPath
|
||||
|
||||
return resp
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"github.com/moby/moby/api/types/container"
|
||||
containerpkg "github.com/moby/moby/v2/daemon/container"
|
||||
)
|
||||
|
||||
// This sets platform-specific fields
|
||||
func setPlatformSpecificContainerFields(ctr *containerpkg.Container, resp *container.InspectResponse) *container.InspectResponse {
|
||||
return resp
|
||||
}
|
||||
Reference in New Issue
Block a user