diff --git a/daemon/inspect.go b/daemon/inspect.go index 13a54ee264..b5dc8a7195 100644 --- a/daemon/inspect.go +++ b/daemon/inspect.go @@ -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{ diff --git a/daemon/inspect_linux.go b/daemon/inspect_linux.go deleted file mode 100644 index fa2e836d33..0000000000 --- a/daemon/inspect_linux.go +++ /dev/null @@ -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 -} diff --git a/daemon/inspect_windows.go b/daemon/inspect_windows.go deleted file mode 100644 index 1855cedf8f..0000000000 --- a/daemon/inspect_windows.go +++ /dev/null @@ -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 -}