Skip to content

Commit

Permalink
sources/skopeo: override exists() method
Browse files Browse the repository at this point in the history
The parent class exists() method checks if there is a file in the
sources cache that matches the checksum.  For containers, the item is a
file called container-image.tar under a directory that matches the
checksum, so for containers it always returned False.
  • Loading branch information
achilleas-k committed Mar 13, 2023
1 parent 77c76fe commit f0b40d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sources/org.osbuild.skopeo
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ class SkopeoSource(sources.SourceService):
with ctx.suppress_oserror(errno.ENOTEMPTY, errno.EEXIST):
os.rename(archive_dir, f"{self.cache}/{image_id}")

def exists(self, checksum, desc):
return os.path.isfile(f"{self.cache}/{checksum}/container-image.tar")


def main():
service = SkopeoSource.from_args(sys.argv[1:])
Expand Down

0 comments on commit f0b40d3

Please sign in to comment.