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 <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai
2025-07-21 19:59:17 -04:00
committed by tomsweeneyredhat
parent db2baee9fa
commit 55f4d2aa25

View File

@ -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),