build_specified_commit: Remove an exception. (#5009)

Return None rather than exceptioning out when a suitable base-builder
cannot be found to allow more graceful error handling.
This commit is contained in:
Oliver Chang 2021-01-20 16:52:49 +11:00 committed by GitHub
parent 433ddc2337
commit 6e41513dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -59,7 +59,8 @@ class BaseBuilderRepo:
if index > 0:
return self.digests[index - 1]
raise ValueError('Failed to find suitable base-builder.')
logging.error('Failed to find suitable base-builder.')
return None
def _replace_gitdir(src_dir, file_path):
@ -269,6 +270,9 @@ def build_fuzzers_from_commit(commit,
# Also use the closest base-builder we can find.
if base_builder_repo:
base_builder_digest = base_builder_repo.find_digest(commit_date)
if not base_builder_digest:
return False
logging.info('Using base-builder with digest %s.', base_builder_digest)
_replace_base_builder_digest(dockerfile_path, base_builder_digest)