Skip to content

Commit

Permalink
[konflux] cachito fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwindasr committed Jan 8, 2025
1 parent 74d53a0 commit 69dc304
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doozer/doozerlib/backend/rebaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 69dc304

Please sign in to comment.