Merge pull request #27309 from ygalblum/quadlet-build-ignorefile

Quadlet build - add support for IgnoreFile key
This commit is contained in:
openshift-merge-bot[bot]
2025-10-17 15:37:32 +00:00
committed by GitHub
4 changed files with 18 additions and 0 deletions

View File

@@ -1725,6 +1725,7 @@ Valid options for `[Build]` are listed below:
| ForceRM=false | --force-rm=false | | ForceRM=false | --force-rm=false |
| GlobalArgs=--log-level=debug | --log-level=debug | | GlobalArgs=--log-level=debug | --log-level=debug |
| GroupAdd=keep-groups | --group-add=keep-groups | | GroupAdd=keep-groups | --group-add=keep-groups |
| IgnoreFile=/path/to/.customignore | --ignorefile=/path/to/.customignore |
| ImageTag=localhost/imagename | --tag=localhost/imagename | | ImageTag=localhost/imagename | --tag=localhost/imagename |
| Label=label | --label=label | | Label=label | --label=label |
| Network=host | --network=host | | Network=host | --network=host |
@@ -1840,6 +1841,13 @@ Assign additional groups to the primary user running within the container proces
This is equivalent to the `--group-add` option of `podman build`. This is equivalent to the `--group-add` option of `podman build`.
### `IgnoreFile=`
Path to an alternate .containerignore file to use when building the image.
Note that when using a relative path you should also set `SetWorkingDirectory=`
This is equivalent to the `--ignorefile` option of `podman build`.
### `ImageTag=` ### `ImageTag=`
Specifies the name which is assigned to the resulting image if the build process completes Specifies the name which is assigned to the resulting image if the build process completes

View File

@@ -114,6 +114,7 @@ const (
KeyHealthTimeout = "HealthTimeout" KeyHealthTimeout = "HealthTimeout"
KeyHostName = "HostName" KeyHostName = "HostName"
KeyHttpProxy = "HttpProxy" KeyHttpProxy = "HttpProxy"
KeyIgnoreFile = "IgnoreFile"
KeyImage = "Image" KeyImage = "Image"
KeyImageTag = "ImageTag" KeyImageTag = "ImageTag"
KeyInterfaceName = "InterfaceName" KeyInterfaceName = "InterfaceName"
@@ -448,6 +449,7 @@ var (
KeyForceRM: true, KeyForceRM: true,
KeyGlobalArgs: true, KeyGlobalArgs: true,
KeyGroupAdd: true, KeyGroupAdd: true,
KeyIgnoreFile: true,
KeyImageTag: true, KeyImageTag: true,
KeyLabel: true, KeyLabel: true,
KeyNetwork: true, KeyNetwork: true,
@@ -1394,6 +1396,7 @@ func ConvertBuild(build *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, isU
stringKeys := map[string]string{ stringKeys := map[string]string{
KeyArch: "--arch", KeyArch: "--arch",
KeyAuthFile: "--authfile", KeyAuthFile: "--authfile",
KeyIgnoreFile: "--ignorefile",
KeyTarget: "--target", KeyTarget: "--target",
KeyVariant: "--variant", KeyVariant: "--variant",
KeyRetry: "--retry", KeyRetry: "--retry",

View File

@@ -0,0 +1,6 @@
## assert-podman-args "--ignorefile" "/path/to/.customignore"
[Build]
ImageTag=localhost/imagename
SetWorkingDirectory=unit
IgnoreFile=/path/to/.customignore

View File

@@ -1056,6 +1056,7 @@ BOGUS=foo
Entry("Build - ForceRM Key", "force-rm.build"), Entry("Build - ForceRM Key", "force-rm.build"),
Entry("Build - GlobalArgs", "globalargs.build"), Entry("Build - GlobalArgs", "globalargs.build"),
Entry("Build - GroupAdd Key", "group-add.build"), Entry("Build - GroupAdd Key", "group-add.build"),
Entry("Build - IgnoreFile Key", "ignorefile.build"),
Entry("Build - Containers Conf Modules", "containersconfmodule.build"), Entry("Build - Containers Conf Modules", "containersconfmodule.build"),
Entry("Build - Label Key", "label.build"), Entry("Build - Label Key", "label.build"),
Entry("Build - Multiple Tags", "multiple-tags.build"), Entry("Build - Multiple Tags", "multiple-tags.build"),