fix new lint errors from the docker update

Some new deprecated fields, we still have to set them since clients
might still use them.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-06-27 16:11:25 +02:00
parent cf87278e66
commit 5786d5f846
2 changed files with 7 additions and 3 deletions

View File

@ -95,11 +95,16 @@ func GetEvents(w http.ResponseWriter, r *http.Request) {
e := entities.ConvertToEntitiesEvent(*evt.Event)
// Some events differ between Libpod and Docker endpoints.
// Handle these differences for Docker-compat.
if !utils.IsLibpodRequest(r) && e.Type == "image" && e.Status == "remove" {
if !utils.IsLibpodRequest(r) && e.Type == "image" && e.Action == "remove" {
// Status is deprecated, but we still like to set it for consumers that might use it.
//nolint:staticcheck,nolintlint // we run the linter several times and sometimes it
// complains about this and sometimes it doesn't thus the nolintlint
e.Status = "delete"
e.Action = "delete"
}
if !utils.IsLibpodRequest(r) && e.Status == "died" {
if !utils.IsLibpodRequest(r) && e.Action == "died" {
//nolint:staticcheck,nolintlint // we run the linter several times and sometimes it
// complains about this and sometimes it doesn't thus the nolintlint
e.Status = "die"
e.Action = "die"
e.Actor.Attributes["exitCode"] = e.Actor.Attributes["containerExitCode"]

View File

@ -578,7 +578,6 @@ func makeExecConfig(options entities.ExecOptions) *handlers.ExecCreateConfig {
createConfig.AttachStdin = options.Interactive
createConfig.AttachStdout = true
createConfig.AttachStderr = true
createConfig.Detach = false
createConfig.DetachKeys = options.DetachKeys
createConfig.Env = env
createConfig.WorkingDir = options.WorkDir