Skip to content

Commit 656d1b0

Browse files
dustymabejlebon
authored andcommitted
cmd-buildfetch: make commitmeta.json and ostree-commit-object optional
In the case where a build is imported using `cosa import` (i.e. either externally built container or built via container with COSA_BUILD_WITH_BUILDAH=1), there is no `commitmeta.json` or `ostree-commit-object`. Let's make these optional when buildfetching.
1 parent 10945dc commit 656d1b0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/cmd-buildfetch

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,14 @@ def main():
147147
assert builddir.startswith("builds/")
148148
builddir = builddir[len("builds/"):]
149149

150-
default_objects = ['meta.json', 'commitmeta.json', 'ostree-commit-object']
150+
default_objects = ['meta.json']
151+
# The commitmeta.json and ostree-commit-object exist in
152+
# the non-container build path so we only try to fetch them
153+
# if they exist.
154+
optional_default_objects = ['commitmeta.json', 'ostree-commit-object']
155+
for f in optional_default_objects:
156+
if fetcher.exists(f'{builddir}/{f}'):
157+
default_objects.append(f)
151158
objects = default_objects + args.file
152159
for f in objects:
153160
fetcher.fetch(f'{builddir}/{f}')

0 commit comments

Comments
 (0)