Skip to content

Commit

Permalink
Store the container annotation in the "containers" directory
Browse files Browse the repository at this point in the history
Like the OBS worker does.
  • Loading branch information
mlschroe committed Sep 11, 2024
1 parent 0302053 commit d97ede9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions osc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ def __init__(self, filename, apiurl, buildtype='spec', localpkgs=None, binarytyp
else:
self.preinstallimage = None

if root.find('containerannotation') is not None:
self.containerannotation = root.find('containerannotation')
else:
self.containerannotation = None

def has_dep(self, name):
for i in self.deps:
if i.name == name:
Expand Down Expand Up @@ -1320,6 +1325,12 @@ def __str__(self):
print("Using prefered package: " + path + "/" + filename)
os.unlink(tffn)

if bi.containerannotation is not None:
if not os.path.exists('containers'):
os.makedirs('containers')
with open('containers/annotation', 'wb') as f:
f.write(bi.containerannotation.encode())

if prefer_pkgs:
localpkgdir = "repos/_local/"
os.mkdir(localpkgdir)
Expand Down

0 comments on commit d97ede9

Please sign in to comment.