mirror of
https://github.com/containers/podman.git
synced 2025-11-29 09:37:38 +08:00
Quadlet build - consider File path that starts with a systemd specifier as absolute
Fixes https://github.com/containers/podman/issues/26746 Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
@@ -1428,7 +1428,7 @@ func ConvertBuild(build *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, isU
|
|||||||
// Context or WorkingDirectory has to be last argument
|
// Context or WorkingDirectory has to be last argument
|
||||||
if len(context) > 0 {
|
if len(context) > 0 {
|
||||||
podman.add(context)
|
podman.add(context)
|
||||||
} else if !filepath.IsAbs(filePath) && !isURL(filePath) {
|
} else if !startsWithSystemdSpecifier(filePath) && !filepath.IsAbs(filePath) && !isURL(filePath) {
|
||||||
// Special handling for relative filePaths
|
// Special handling for relative filePaths
|
||||||
if len(workingDirectory) == 0 {
|
if len(workingDirectory) == 0 {
|
||||||
return nil, warnings, fmt.Errorf("relative path in File key requires SetWorkingDirectory key to be set")
|
return nil, warnings, fmt.Errorf("relative path in File key requires SetWorkingDirectory key to be set")
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[Build]
|
||||||
|
ImageTag=localhost/example
|
||||||
|
File=%h/images/example.Containerfile
|
||||||
@@ -1074,6 +1074,7 @@ BOGUS=foo
|
|||||||
Entry("Build - Variant Key", "variant.build"),
|
Entry("Build - Variant Key", "variant.build"),
|
||||||
Entry("Build - No Default Dependencies", "no_deps.build"),
|
Entry("Build - No Default Dependencies", "no_deps.build"),
|
||||||
Entry("Build - Retry", "retry.build"),
|
Entry("Build - Retry", "retry.build"),
|
||||||
|
Entry("Build - No WorkingDirectory with systemd specifier", "no-workingdirectory-systemd-specifier.build"),
|
||||||
|
|
||||||
Entry("Pod - Basic", "basic.pod"),
|
Entry("Pod - Basic", "basic.pod"),
|
||||||
Entry("Pod - DNS", "dns.pod"),
|
Entry("Pod - DNS", "dns.pod"),
|
||||||
|
|||||||
Reference in New Issue
Block a user