Skip to content

Commit

Permalink
scan-sources: Request a rebuild if parent image is newer (openshift-e…
Browse files Browse the repository at this point in the history
  • Loading branch information
vfreex authored Sep 3, 2021
1 parent 9ecc076 commit 00db566
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doozerlib/cli/scan_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,16 @@ def add_image_meta_change(meta, rebuild_hint: RebuildHint):
if image_meta in changing_image_metas:
continue # A rebuild is already requested.

# Request a rebuild if A is a dependent of B but the latest build of A is older than B.
# Request a rebuild if A is a dependent (operator or child image) of B but the latest build of A is older than B.
rebase_time = util.isolate_timestamp_in_release(info["release"])
if not rebase_time: # no timestamp string in NVR?
continue
rebase_time = datetime.strptime(rebase_time, "%Y%m%d%H%M%S").replace(tzinfo=timezone.utc)
for dep_key in image_meta.dependencies:
dependencies = image_meta.dependencies.copy()
base_image = image_meta.config["from"].member
if base_image:
dependencies.add(base_image)
for dep_key in dependencies:
dep = runtime.image_map.get(dep_key)
if not dep:
runtime.logger.warning("Image %s has unknown dependency %s. Is it excluded?", image_meta.distgit_key, dep_key)
Expand Down

0 comments on commit 00db566

Please sign in to comment.