From 55f4d2aa25e9220aa8c209ece99b74948b379de5 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mon, 21 Jul 2025 19:59:17 -0400 Subject: [PATCH] API handler: don't force the CompatVolumes flag Don't force the CompatVolumes option one way or another when the client doesn't specifically request one or the other, so that the server can choose to use its default behavior. Signed-off-by: Nalin Dahyabhai --- pkg/api/handlers/compat/images_build.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index 737b7ad293..aaa7a0bf8c 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -302,6 +302,11 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { compression := archive.Compression(query.Compression) + var compatVolumes types.OptionalBool + if _, found := r.URL.Query()["compatvolumes"]; found { + compatVolumes = types.NewOptionalBool(query.CompatVolumes) + } + // convert dropcaps formats var dropCaps = []string{} if _, found := r.URL.Query()["dropcaps"]; found { @@ -742,7 +747,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { Secrets: secrets, Volumes: query.Volumes, }, - CompatVolumes: types.NewOptionalBool(query.CompatVolumes), + CompatVolumes: compatVolumes, CreatedAnnotation: query.CreatedAnnotation, Compression: compression, ConfigureNetwork: parseNetworkConfigurationPolicy(query.ConfigureNetwork),