Skip to content

Conversation

@FrostyX
Copy link
Member

@FrostyX FrostyX commented Jan 27, 2026

In internal Copr we do this:

./prepare-worker
mkdir /var/lib/containers/output
ln -s /var/lib/containers/output ~/copr-image-builder/output

so we need to follow the symlink otherwise the image is not found

In internal Copr we do this:

    ./prepare-worker
    mkdir /var/lib/containers/output
    ln -s /var/lib/containers/output ~/copr-image-builder/output

so we need to follow the symlink otherwise the image is not found
@gemini-code-assist
Copy link

Summary of Changes

Hello @FrostyX, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where the image build process failed to locate the disk.raw file when the output directory was a symbolic link. By modifying the find command to follow symlinks, the change ensures robust image discovery in environments that utilize symbolic links for directory management, such as internal Copr setups. This directly addresses the problem of images not being found due to indirect pathing.

Highlights

  • Symlink Resolution for AMI Images: The find command used to locate disk.raw files for AMI image creation now includes the -L option, enabling it to follow symbolic links. This ensures that images can be found even when the output directory is a symlink.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the -L flag to the find command to follow symbolic links when locating the disk.raw image for AMI builds. This change correctly addresses the issue described where the output directory is a symlink. However, the change is incomplete. Other find commands in the same script that search the output directory (on lines 53, 58, and 61) are not updated. This inconsistency can lead to failures when building other image types or even when reporting the path of the created AMI image. I have provided a suggestion to fix this within the changed hunk, and recommend applying the -L flag to all find commands that traverse the output directory for a more robust solution.

Comment on lines 53 to 59
find output -name disk.qcow2
;;
ami)
image=$(find output -name disk.raw)
image=$(find -L output -name disk.raw)
mv "$image" "${image//.raw/.ami}"
find output -name disk.ami
;;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

For consistency and to correctly handle cases where output is a symlink across different image types, the -L flag should be applied to all find commands searching in the output directory. This suggestion adds it for the qcow2 type and for finding the final .ami file, ensuring the script behaves correctly and consistently.

Suggested change
find output -name disk.qcow2
;;
ami)
image=$(find output -name disk.raw)
image=$(find -L output -name disk.raw)
mv "$image" "${image//.raw/.ami}"
find output -name disk.ami
;;
find -L output -name disk.qcow2
;;
ami)
image=$(find -L output -name disk.raw)
mv "$image" "${image//.raw/.ami}"
find -L output -name disk.ami
;;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants