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

Commit

Permalink
Revert "make bundle tag names configurable (#532)" (#533)
Browse files Browse the repository at this point in the history
This reverts commit 3a14f91.
  • Loading branch information
vfreex authored Nov 11, 2021
1 parent 3a14f91 commit 57af5c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
10 changes: 2 additions & 8 deletions doozerlib/distgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,6 @@ def _update_csv(self, version, release):
registry = csv_config['registry'].rstrip("/")
image_map = csv_config.get('image-map', {})

name_in_bundle = self.metadata.config.get('name_in_bundle', None)
for ref in image_refs:
try:
name = build_image_ref_name(ref['name'])
Expand All @@ -1877,15 +1876,10 @@ def _update_csv(self, version, release):
raise DoozerFatalError('Error loading image-references data for {}'.format(self.metadata.distgit_key))

try:
# ref is current image
if name == self.metadata.image_name_short or name_in_bundle and ref['name'] == name_in_bundle:
if name == self.metadata.image_name_short: # ref is current image
image_tag = '{}:{}-{}'.format(name, version, release)
else:
# try to find by ref['name'], which is enabled by name_in_bundle field
# indexed in map at initialization
distgit = self.runtime.image_distgit_by_name(ref['name'])
if not distgit:
distgit = self.runtime.image_distgit_by_name(name)
distgit = self.runtime.image_distgit_by_name(name)
# if upstream is referring to an image we don't actually build, give up.
if not distgit:
raise DoozerFatalError('Unable to find {} in image-references data for {}'.format(name, self.metadata.distgit_key))
Expand Down
11 changes: 1 addition & 10 deletions doozerlib/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,15 +593,6 @@ def filter_disabled(n, d):
self.image_name_map[name] = img.key
self.image_name_map[short_name] = img.key

name_in_bundle = img.data.get('name_in_bundle', None)
if name_in_bundle and name_in_bundle!=name and name_in_bundle!=name:
if name_in_bundle in self.image_name_map:
self.logger.warning(
f"name_in_bundle field in conflict with another image name/shortname, for image={name} "
f"name_in_bundle={name_in_bundle}.")
else:
self.image_name_map[name_in_bundle] = img.key

image_data = self.gitdata.load_data(path='images', keys=image_keys,
exclude=image_ex,
replace_vars=replace_vars,
Expand Down Expand Up @@ -856,7 +847,7 @@ def add_child_branch(child, branch, level=1):
self.image_order.append(i)

def image_distgit_by_name(self, name):
"""Returns image meta by full name, short name, name_in_bundle or distgit"""
"""Returns image meta by full name, short name, or distgit"""
return self.image_name_map.get(name, None)

def rpm_metas(self) -> List[RPMMetadata]:
Expand Down

0 comments on commit 57af5c8

Please sign in to comment.