daemon: consolidate platform-specific inspectExecProcessConfig

This function was introduced in 1af76ef597
and based on the previous code in the daemon, which had platform-specific
handling for exec inspect in [setPlatformSpecificExecProcessConfig], which
was added in 5fa2e4d4f2 to account for
Windows not having "Privileged" and not setting the "User".

Given that "User" would be empty and "Privileged" not set, we may as well
combine both platforms, and just return the info we have.

[setPlatformSpecificExecProcessConfig]: 1af76ef597/daemon/exec_unix.go (L11-L21)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-07-11 14:05:57 +02:00
parent ff14d7edf0
commit 1e499bae79
3 changed files with 26 additions and 32 deletions

View File

@@ -3,18 +3,9 @@ package daemon
import (
"github.com/moby/moby/api/types/container"
containerpkg "github.com/moby/moby/v2/daemon/container"
"github.com/moby/moby/v2/daemon/server/backend"
)
// This sets platform-specific fields
func setPlatformSpecificContainerFields(container *containerpkg.Container, contJSONBase *container.ContainerJSONBase) *container.ContainerJSONBase {
return contJSONBase
}
func inspectExecProcessConfig(e *containerpkg.ExecConfig) *backend.ExecProcessConfig {
return &backend.ExecProcessConfig{
Tty: e.Tty,
Entrypoint: e.Entrypoint,
Arguments: e.Args,
}
}