buildextend-legacy-oscontainer.py: make `--output` required
It's not really useful anymore without passing that.
@@ -209,7 +209,6 @@ def oscontainer_build(containers_storage, tmpdir, src, ref, image_name_and_tag,
subprocess.call(buildah_base_argv + ['umount', bid], stdout=subprocess.DEVNULL)
subprocess.call(buildah_base_argv + ['rm', bid], stdout=subprocess.DEVNULL)
- if output:
print("Saving container to oci-archive")
podCmd = buildah_base_argv + ['push']
@@ -230,10 +229,6 @@ def oscontainer_build(containers_storage, tmpdir, src, ref, image_name_and_tag,
podCmd.append(f'oci-archive:{output}')
cmdlib.runcmd(podCmd)
- elif digestfile is not None:
- inspect = run_get_json(buildah_base_argv + ['inspect', image_name_and_tag])[0]
- with open(digestfile, 'w') as f:
- f.write(inspect['Digest'])
def main():
@@ -274,7 +269,7 @@ def main():
help="Write image digest to file",
action='store',
metavar='FILE')
- parser.add_argument("--output", help="Write image as OCI archive to file")
+ parser.add_argument("--output", required=True, help="Write image as OCI archive to file")
args = parser.parse_args()
labeled_pkgs = []
