Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
olm: Fail with non declared dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
joepvd committed Dec 4, 2022
1 parent 30c8f14 commit 31216ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doozerlib/distgit.py
Expand Up @@ -2119,9 +2119,10 @@ def _update_csv(self, version, release):

try:
distgit = self.runtime.name_in_bundle_map.get(name, None)
# if upstream is referring to an image we don't actually build, give up.
# fail if upstream is referring to an image we don't actually build
if not distgit:
raise DoozerFatalError('Unable to find {} in image-references data for {}'.format(name, self.metadata.distgit_key))

meta = self.runtime.image_map.get(distgit, None)
if meta: # image is currently be processed
uuid_tag = "%s.%s" % (version, self.runtime.uuid) # applied by additional-tags
Expand All @@ -2131,6 +2132,10 @@ def _update_csv(self, version, release):
_, v, r = meta.get_latest_build_info()
image_tag = '{}:{}-{}'.format(meta.image_name_short, v, r)

if self.metadata.distgit_key != meta.distgit_key:
if self.metadata.distgit_key not in meta.config.dependents:
raise DoozerFatalError(f'Related image contains {meta.distgit_key} but this does not have {self.metadata.distgit_key} in dependents')

namespace = self.runtime.group_config.get('csv_namespace', None)
if not namespace:
raise DoozerFatalError('csv_namespace is required in group.yaml when any image defines update-csv')
Expand Down

0 comments on commit 31216ef

Please sign in to comment.