Skip to content

Commit 2393461

Browse files
committed
api/exec: fall back to system default DetachKeys when not provided
1 parent 3281559 commit 2393461

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/api/handlers/compat/exec.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ func ExecCreateHandler(w http.ResponseWriter, r *http.Request) {
8282
}
8383
libpodConfig.ExitCommand = exitCommandArgs
8484

85+
// When DetachKeys was not provided, store the system default so that
86+
// exec inspect returns a meaningful value rather than an empty string.
87+
if libpodConfig.DetachKeys == nil {
88+
libpodConfig.DetachKeys = &runtimeConfig.Engine.DetachKeys
89+
}
90+
8591
// Run the exit command after 5 minutes, to mimic Docker's exec cleanup
8692
// behavior.
8793
libpodConfig.ExitCommandDelay = runtimeConfig.Engine.ExitCommandDelay

0 commit comments

Comments
 (0)