From add32e4b513b5237660002c62892b9cd87bfadf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Mon, 17 Feb 2025 12:36:48 +0100 Subject: [PATCH] cli/compose: Handle Volume Subpath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- cli/compose/convert/volume.go | 1 + cli/compose/types/types.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/compose/convert/volume.go b/cli/compose/convert/volume.go index a60f4bd32e..0073e4ee1a 100644 --- a/cli/compose/convert/volume.go +++ b/cli/compose/convert/volume.go @@ -67,6 +67,7 @@ func handleVolumeToMount( if volume.Volume != nil { result.VolumeOptions.NoCopy = volume.Volume.NoCopy + result.VolumeOptions.Subpath = volume.Volume.Subpath } if stackVolume.Name != "" { diff --git a/cli/compose/types/types.go b/cli/compose/types/types.go index ef778422bc..e971db88d5 100644 --- a/cli/compose/types/types.go +++ b/cli/compose/types/types.go @@ -410,7 +410,8 @@ type ServiceVolumeBind struct { // ServiceVolumeVolume are options for a service volume of type volume type ServiceVolumeVolume struct { - NoCopy bool `mapstructure:"nocopy" yaml:"nocopy,omitempty" json:"nocopy,omitempty"` + NoCopy bool `mapstructure:"nocopy" yaml:"nocopy,omitempty" json:"nocopy,omitempty"` + Subpath string `mapstructure:"subpath" yaml:"subpath,omitempty" json:"subpath,omitempty"` } // ServiceVolumeImage are options for a service volume of type image