Skip to content

OpenShift deployment: stop building rhpkg images, fix git safe.directory, set agent identity - #458

Merged
TomasTomecek merged 3 commits into
packit:mainfrom
TomasTomecek:depl-4
May 7, 2026
Merged

OpenShift deployment: stop building rhpkg images, fix git safe.directory, set agent identity#458
TomasTomecek merged 3 commits into
packit:mainfrom
TomasTomecek:depl-4

Conversation

@TomasTomecek

Copy link
Copy Markdown
Member

Summary

Three deployment fixes for the OpenShift setup:

  • Stop building/pushing images that require rhpkg — these images depend
    on Red Hat internal tooling and cannot be built in CI. They are now excluded
    from the build-and-push workflow.

  • Set git identity in agent containers — configure user.email and
    user.name in Containerfile.c9s and Containerfile.c10s so agents can
    commit without needing runtime git config.

  • Fix "dubious ownership" on /git-repos volume — the shared git-repos
    volume is owned by a different UID than the container process. Added
    safe.directory entries for /git-repos/* and /git-repos/applicability/*
    to all three Containerfiles (c9s, c10s: via --global after the user
    switch; mcp: via --system since git config runs before USER mcp).

🤖 Generated with Claude Code

we're building them internally

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

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

Copy link
Copy Markdown
Contributor

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 updates Git configurations in several Containerfiles to resolve ownership issues by adding directories to the safe.directory setting. Feedback highlights that Git's safe.directory does not support shell-style wildcards and recommends using * instead. Additionally, it was noted that the PR description mentions CI changes that are not present in the code.

Comment thread Containerfile.c10s
Comment thread Containerfile.c9s
Comment thread Containerfile.mcp
Comment on lines +47 to +51
# we tell git that all repos in /git-repos/* and .../applicability/* are safe to fetch into
# because this is a volume that has different owner than our container process
RUN mkdir /git-repos && chmod -R o+rwX /git-repos && \
git config --system --add safe.directory '/git-repos/*' && \
git config --system --add safe.directory '/git-repos/applicability/*'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Git's safe.directory configuration does not support shell-style wildcards like /git-repos/*. It only accepts literal paths or the special value * to trust all directories. Since /git-repos is a volume containing multiple repositories, you should use * to trust all directories within this container environment.

# we tell git that all repos are safe to fetch into because this is a volume
# that has a different owner than our container process.
RUN mkdir /git-repos && chmod -R o+rwX /git-repos && \
    git config --system --add safe.directory '*'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You are incorrect, this absolutely works:

sh-5.2$ cat ~/.gitconfig
[safe]
        directory = /git-repos
        directory = /git-repos/*

sh-5.2$ cd /git-repos/

sh-5.2$ ls -lha
total 16K
drwxrwxr-x  5 1005040000   99 4.0K May  7 06:36 .
dr-xr-xr-x. 1 root       root   51 May  4 15:09 ..
drwxr-xr-x  2 1005040000   99 4.0K May  4 15:12 applicability
drwxr-xr-x  3 1005040000   99 4.0K May  7 06:30 foobar
drwxr-xr-x  3         99   99 4.0K May  7 06:37 foobar2

sh-5.2$ cd foobar2

sh-5.2$ git status
On branch master

No commits yet

nothing to commit (create/copy files and use "git add" to track)

sh-5.2$ mv ~/.gitconfig{,.nope}

sh-5.2$ git status
fatal: detected dubious ownership in repository at '/git-repos/foobar2'
To add an exception for this directory, call:

        git config --global --add safe.directory /git-repos/foobar2

Comment thread Containerfile.c10s

# so that we can start working with gitlab.com immediately
RUN git config --global user.email "jotnar@redhat.com" \
RUN git config --global user.email "redhat-ymir-agent@redhat.com" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The pull request title and description mention stopping the building and pushing of images that require rhpkg, but there are no changes to CI workflows or build scripts in this pull request. If this was intended to be part of this PR, please ensure the relevant configuration files (e.g., GitHub Actions or GitLab CI) are included.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

how about 98c9ce7 ?

@lbarcziova lbarcziova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@TomasTomecek
TomasTomecek merged commit 52a6fb2 into packit:main May 7, 2026
9 checks passed
@TomasTomecek
TomasTomecek deleted the depl-4 branch May 7, 2026 13:07
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