Skip to content

Commit c8854f2

Browse files
Merge pull request #27027 from ygalblum/quadlet-build-file-spec
Quadlet build - consider File path that starts with a systemd specifier as absolute
2 parents 3d5aeba + 936a01e commit c8854f2

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

pkg/systemd/quadlet/quadlet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ func ConvertBuild(build *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, isU
14281428
// Context or WorkingDirectory has to be last argument
14291429
if len(context) > 0 {
14301430
podman.add(context)
1431-
} else if !filepath.IsAbs(filePath) && !isURL(filePath) {
1431+
} else if !startsWithSystemdSpecifier(filePath) && !filepath.IsAbs(filePath) && !isURL(filePath) {
14321432
// Special handling for relative filePaths
14331433
if len(workingDirectory) == 0 {
14341434
return nil, warnings, fmt.Errorf("relative path in File key requires SetWorkingDirectory key to be set")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[Build]
2+
ImageTag=localhost/example
3+
File=%h/images/example.Containerfile

test/e2e/quadlet_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,7 @@ BOGUS=foo
10741074
Entry("Build - Variant Key", "variant.build"),
10751075
Entry("Build - No Default Dependencies", "no_deps.build"),
10761076
Entry("Build - Retry", "retry.build"),
1077+
Entry("Build - No WorkingDirectory with systemd specifier", "no-workingdirectory-systemd-specifier.build"),
10771078

10781079
Entry("Pod - Basic", "basic.pod"),
10791080
Entry("Pod - DNS", "dns.pod"),

0 commit comments

Comments
 (0)