Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update common, upgrading gitops operator to 1.11 #20

Merged
merged 8 commits into from
Jan 19, 2024

Conversation

mhjacks
Copy link
Contributor

@mhjacks mhjacks commented Jan 19, 2024

No description provided.

mbaldessari and others added 8 commits January 17, 2024 16:50
Tested on both ocp 4.14 and 4.12.
4.12 is the oldest supported version at this point in time.
Switch default gitops channel to gitops-1.11
The reason for this is somewhat multi-faceted, but boils down to the
fact that openssh does not consult the $HOME variable to find .ssh/*
files but only relies to the home folder entry in /etc/passwd.

So what might happen is the following scenario:
1. The remote is ssh based: `origin  [email protected]:validatedpatterns/industrial-edge`
2. The main Makefile invokes `git remote show origin` which triggers an ssh connection
3. The ssh connection fails because ssh ignores the $HOME variable and instead relies on the home in `getent passwd`. Which is set to:
   ```
   fedora:*:1000:1000:fedora Cloud User:/home/fedora/industrial-edge:/bin/sh
   ```
4. Newer podmans set the user's home folder automagically to the folder
   that is passed as current working directory (in our case we pass `-w
   $(pwd)`)

Under these circumstances ssh connection will fail because git+ssh will
look for ssh files in the current folder (aka entry in /etc/passwd):

        debug1: identity file /home/fedora/industrial-edge/.ssh/id_rsa type -1
        debug1: identity file /home/fedora/industrial-edge/.ssh/id_rsa-cert type -1

Fix this by making sure we force an /etc/passwd entry for the user
running podman that points to the $HOME directory (aka /pattern-home
inside the container).
Set the user's passwd entry inside the container
This is the version we use in gitops-1.11 which is the new default
@mhjacks mhjacks merged commit 8e34d60 into validatedpatterns:main Jan 19, 2024
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