Skip to content

Commit

Permalink
Merge pull request #1176 from locriandev/exclude-disabled-images-from…
Browse files Browse the repository at this point in the history
…-scan-report

Exclude images not enabled in Konflux from the scan report
  • Loading branch information
openshift-merge-bot[bot] authored Dec 5, 2024
2 parents 68915c7 + 50e347b commit a8349c3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doozer/doozerlib/cli/scan_sources_konflux.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,21 @@ def add_image_meta_change(self, meta: ImageMetadata, rebuild_hint: RebuildHint):
self.add_assessment_reason(descendant_meta, RebuildHint(RebuildHintCode.ANCESTOR_CHANGING,
f'Ancestor {meta.distgit_key} is changing'))

def is_image_enabled(self, image_name: str) -> bool:
image_meta = self.runtime.image_map[image_name]
mode = image_meta.config.konflux.mode
enabled = mode != 'disabled' and mode != 'wip'
if not enabled:
self.logger.warning('Excluding image %s from the report as it is not enabled in Konflux', image_name)
return enabled

def generate_report(self):
image_results = []
changing_image_names = [name for name in self.changing_image_names]

# Filter out images that are disabled or wip at the konflux level
changing_image_names = list(filter(lambda image_name: self.is_image_enabled(image_name), changing_image_names))

for image_meta in self.all_image_metas:
dgk = image_meta.distgit_key
is_changing = dgk in changing_image_names
Expand Down

0 comments on commit a8349c3

Please sign in to comment.