bib: deprecate the --local flag

Pulling container images before building would break in the case of
authenticated images on podman machine, since the auth file lives on the
host and not podman machine and won't know about it.

This commit deprecates the `--local` flag and warns users when it is
passed to the CLI so that this won't break things for anyone who might
already be using the flag. This change means that the user will have to
ensure that the container is pulled to the local container store before
initiating the build.

Co-authored-by: Ondřej Budai <obudai@redhat.com>
This commit is contained in:
Gianluca Zuccarelli 2024-05-03 12:36:52 +01:00 committed by Simon de Vlieger
parent c74c402d74
commit 441d408aee

View file

@ -153,7 +153,9 @@ func validateCanRunTargetArch(targetArch string) error {
func ValidateHasContainerTags(imgref string) error {
output, err := exec.Command("podman", "image", "inspect", imgref, "--format", "{{.Labels}}").Output()
if err != nil {
return fmt.Errorf("failed inspect image: %w", util.OutputErr(err))
return fmt.Errorf(`failed to inspect the image: %w
bootc-image-builder no longer pulls images, make sure to pull it before running bootc-image-builder:
sudo podman pull %s`, util.OutputErr(err), imgref)
}
tags := string(output)