From 3ac848ab75c10b67988110eb36dca06db0e35968 Mon Sep 17 00:00:00 2001 From: Urvashi Date: Tue, 10 Dec 2024 08:36:24 -0500 Subject: [PATCH] Add AUTHFILE option to make image When building the mco image, add an AUTHFILE check to allow users to specify a different file from the default one for the authentication to be used during the build process. Signed-off-by: Urvashi --- hack/build-image | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hack/build-image b/hack/build-image index f3dc4fdb0b..0489999745 100755 --- a/hack/build-image +++ b/hack/build-image @@ -41,6 +41,11 @@ else: print(f"HEAD commit: {gitrev}") args = [podman, 'build', '-t', imgname, '--no-cache', '.'] +# Check if AUTHFILE environment variable is set. Setting this allows the user to specify which file to use +# for the authentication when building the image +authfile = os.environ.get('AUTHFILE') +if authfile: + args.extend(['--authfile', authfile]) for k in openshift_keys: args.append(f'--label={k}=') args.extend([f'--label=vcs-ref={gitrev}', '--label=vcs-type=git', '--label=vcs-url='])