From 720e2637679237c680768c033248d3a385f3c785 Mon Sep 17 00:00:00 2001 From: givensuman Date: Wed, 8 Oct 2025 12:44:11 -0400 Subject: [PATCH] Add BuildArg key to quadlets Signed-off-by: givensuman --- pkg/systemd/quadlet/quadlet.go | 3 +++ test/e2e/quadlet/buildarg.build | 8 ++++++++ test/e2e/quadlet_test.go | 1 + 3 files changed, 12 insertions(+) create mode 100644 test/e2e/quadlet/buildarg.build diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go index c077043f9d..bc5f899c0d 100644 --- a/pkg/systemd/quadlet/quadlet.go +++ b/pkg/systemd/quadlet/quadlet.go @@ -63,6 +63,7 @@ const ( KeyArch = "Arch" KeyAuthFile = "AuthFile" KeyAutoUpdate = "AutoUpdate" + KeyBuildArg = "BuildArg" KeyCertDir = "CertDir" KeyCgroupsMode = "CgroupsMode" KeyConfigMap = "ConfigMap" @@ -433,6 +434,7 @@ var ( KeyAnnotation: true, KeyArch: true, KeyAuthFile: true, + KeyBuildArg: true, KeyContainersConfModule: true, KeyDNS: true, KeyDNSOption: true, @@ -1391,6 +1393,7 @@ func ConvertBuild(build *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, isU lookupAndAddAllStrings(build, BuildGroup, allStringKeys, podman) keyValKeys := map[string]string{ + KeyBuildArg: "--build-arg", KeyEnvironment: "--env", KeyLabel: "--label", KeyAnnotation: "--annotation", diff --git a/test/e2e/quadlet/buildarg.build b/test/e2e/quadlet/buildarg.build new file mode 100644 index 0000000000..e6866181fc --- /dev/null +++ b/test/e2e/quadlet/buildarg.build @@ -0,0 +1,8 @@ +## assert-podman-args "--build-arg" "FOO=BAR" +## assert-podman-args "--build-arg" "BIZ=BAZ" + +[Build] +ImageTag=image:latest +SetWorkingDirectory=unit +BuildArg=FOO=BAR +BuildArg=BIZ=BAZ diff --git a/test/e2e/quadlet_test.go b/test/e2e/quadlet_test.go index 44dad370d5..cc526046fe 100644 --- a/test/e2e/quadlet_test.go +++ b/test/e2e/quadlet_test.go @@ -1059,6 +1059,7 @@ BOGUS=foo Entry("Build - Multiple Tags", "multiple-tags.build"), Entry("Build - Network Key host", "network.build"), Entry("Build - PodmanArgs", "podmanargs.build"), + Entry("Build - BuildArg Key", "buildarg.build"), Entry("Build - Pull Key", "pull.build"), Entry("Build - Secrets", "secrets.build"), Entry("Build - SetWorkingDirectory is absolute path", "setworkingdirectory-is-abs.build"),