Skip to content

Commit 835a27f

Browse files
committed
cmd-build-with-buildah: add --strict
All the logic for this actually lives directly in `build-rootfs`, so just pass it through to that.
1 parent b51dc2d commit 835a27f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/cmd-build-with-buildah

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Usage: coreos-assembler build-with-buildah
2020
--autolock=VERSION If no base lockfile used, create one from any arch build of `VERSION`.
2121
Note this is automatically enabled when adding to an existing multi-arch
2222
non-strict build.
23-
--skip-prune Skip prunning previous builds
23+
--skip-prune Skip prunning previous builds.
24+
--strict Only allow installing locked packages when using lockfiles.
2425
--parent-build=VERSION This option does nothing and is provided for backwards compatibility.
2526
--force This option does nothing and is provided for backwards compatibility.
2627
EOF
@@ -31,8 +32,9 @@ VERSIONARY=
3132
DIRECT=
3233
AUTOLOCK_VERSION=
3334
SKIP_PRUNE=
35+
STRICT=
3436
rc=0
35-
options=$(getopt --options h,d --longoptions help,version:,versionary,direct,autolock:,skip-prune,parent-build:,force -- "$@") || rc=$?
37+
options=$(getopt --options h,d --longoptions help,version:,versionary,direct,autolock:,skip-prune,parent-build:,force,strict -- "$@") || rc=$?
3638
[ $rc -eq 0 ] || {
3739
print_help
3840
exit 1
@@ -61,6 +63,9 @@ while true; do
6163
--skip-prune)
6264
SKIP_PRUNE=1
6365
;;
66+
--strict)
67+
STRICT=1
68+
;;
6469
--parent-build)
6570
shift
6671
;;
@@ -161,6 +166,10 @@ build_with_buildah() {
161166
-v /etc/pki/ca-trust:/etc/pki/ca-trust:ro
162167
fi
163168

169+
if [ -n "${STRICT}" ]; then
170+
set -- "$@" --build-arg STRICT_MODE=1
171+
fi
172+
164173
if [ -d overrides ]; then
165174
if [ -d overrides/rpm ]; then
166175
# Clean up any previous repo metadata

0 commit comments

Comments
 (0)