From d0819591d9c07b9760e161e26c173cb7f03d3c78 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Wed, 25 Sep 2024 18:11:14 -0500 Subject: [PATCH] Make `buildah manifest push --all` true by default Changed the `--all` option of `buildah manifest push` to be true by default. This matches the behavior of the equivalent Podman option (`podman manifest push --all`), making it easier to switch between Podman and Buildah. Updated buildah.manifest.push.1 docs to reflect this change. Added test "manifest-push-all-default-true" to `tests/lists.bats`. Closes: #5547 Signed-off-by: Paul Nettleton --- cmd/buildah/manifest.go | 2 +- docs/buildah-manifest-push.1.md | 2 +- tests/lists.bats | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/buildah/manifest.go b/cmd/buildah/manifest.go index 29b276a1a14..52d161b6dbc 100644 --- a/cmd/buildah/manifest.go +++ b/cmd/buildah/manifest.go @@ -246,7 +246,7 @@ func init() { manifestPushCommand.SetUsageTemplate(UsageTemplate()) flags = manifestPushCommand.Flags() flags.BoolVar(&manifestPushOpts.rm, "rm", false, "remove the manifest list if push succeeds") - flags.BoolVar(&manifestPushOpts.all, "all", false, "also push the images in the list") + flags.BoolVar(&manifestPushOpts.all, "all", true, "also push the images in the list") flags.StringVar(&manifestPushOpts.authfile, "authfile", auth.GetDefaultAuthFile(), "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") flags.StringVar(&manifestPushOpts.certDir, "cert-dir", "", "use certificates at the specified path to access the registry") flags.StringVar(&manifestPushOpts.creds, "creds", "", "use `[username[:password]]` for accessing the registry") diff --git a/docs/buildah-manifest-push.1.md b/docs/buildah-manifest-push.1.md index f53d88c093d..97ee58d77a7 100644 --- a/docs/buildah-manifest-push.1.md +++ b/docs/buildah-manifest-push.1.md @@ -30,7 +30,7 @@ original instance. **--all** Push the images mentioned in the manifest list or image index, in addition to -the list or index itself. +the list or index itself. (Default true) **--authfile** *path* diff --git a/tests/lists.bats b/tests/lists.bats index 8a7e1399230..b36edb313b8 100644 --- a/tests/lists.bats +++ b/tests/lists.bats @@ -226,6 +226,11 @@ IMAGE_LIST_S390X_INSTANCE_DIGEST=sha256:882a20ee0df7399a445285361d38b711c299ca09 expect_output --substring ${IMAGE_LIST_S390X_INSTANCE_DIGEST##sha256:} } +@test "manifest-push-all-default-true" { + run_buildah manifest push --help + expect_output --substring "all.*\(default true\).*authfile" +} + @test "manifest-push-purge" { run_buildah manifest create foo run_buildah manifest add --arch=arm64 foo ${IMAGE_LIST}