From 69dc304179839388ecfac1d7f4167dc72197405d Mon Sep 17 00:00:00 2001 From: Ashwin Das Date: Wed, 8 Jan 2025 13:14:31 -0500 Subject: [PATCH] [konflux] cachito fix --- doozer/doozerlib/backend/rebaser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doozer/doozerlib/backend/rebaser.py b/doozer/doozerlib/backend/rebaser.py index 9c813784c..da01e72b5 100644 --- a/doozer/doozerlib/backend/rebaser.py +++ b/doozer/doozerlib/backend/rebaser.py @@ -751,7 +751,7 @@ def _update_dockerfile(self, metadata: ImageMetadata, source: Optional[SourceRes # Inject build repos for Konflux self._add_build_repos(dfp) - self._modify_cachito_commands(df_path) + self._modify_cachito_commands(metadata, df_path) self._reflow_labels(df_path) @@ -774,7 +774,7 @@ def _add_build_repos(self, dfp: DockerfileParser): "# End Konflux-specific steps\n\n" ) - def _modify_cachito_commands(self, df_path): + def _modify_cachito_commands(self, metadata, df_path): """ Konflux does not support cachito, comment it out to support green non-hermetic builds For yarn, download it if its missing. @@ -802,7 +802,7 @@ def _modify_cachito_commands(self, df_path): yarn_line_updated = False continue - if "REMOTE_SOURCES" in line or "REMOTE_SOURCE_DIR" in line: + if metadata.config.get("konflux", {}).get("cachito").get("comment", True) and ("REMOTE_SOURCES" in line or "REMOTE_SOURCE_DIR" in line): # Comment lines containing 'REMOTE_SOURCES' or 'REMOTE_SOURCES_DIR' since cachito is not supported in konflux updated_lines.append(f"#{line.strip()}\n") line_commented = True