Skip to content

Commit

Permalink
Allow binaryless images to have the hidden DB
Browse files Browse the repository at this point in the history
Remove a bad conditional which prevents binaryless images to have a
hidden DB.

Signed-off-by: Jonathan Gangi <jgangi@redhat.com>
  • Loading branch information
JAVGan committed Feb 7, 2025
1 parent 38d021d commit 06c8bf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 4 additions & 5 deletions iib/workers/tasks/opm_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,11 +647,10 @@ def create_dockerfile(
log.info('Rewriting Dockerfile %s with newly generated by opm.', dockerfile_path)
os.rename(dockerfile_path_opm_default, dockerfile_path)

if binary_image != "scratch":
db_path = get_worker_config()['hidden_index_db_path']
rel_path_index_db = os.path.relpath(index_db, base_dir)
with open(dockerfile_path, 'a') as f:
f.write(f'\nADD {rel_path_index_db} {db_path}\n')
db_path = get_worker_config()['hidden_index_db_path']
rel_path_index_db = os.path.relpath(index_db, base_dir)
with open(dockerfile_path, 'a') as f:
f.write(f'\nADD {rel_path_index_db} {db_path}\n')

log.info("Dockerfile was successfully generated.")
return dockerfile_path
Expand Down
2 changes: 2 additions & 0 deletions tests/test_workers/test_tasks/test_opm_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ def test_create_dockerfile_binaryless(tmpdir, dockerfile):
# Set DC-specific label for the location of the DC root directory
# in the image
LABEL operators.operatorframework.io.index.configs.v1=/configs
ADD database/index.db /var/lib/iib/_hidden/do.not.edit.db
'''
)
assert dockerfile == expected_dockerfile
Expand Down

0 comments on commit 06c8bf8

Please sign in to comment.