Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The operator runs as PID 1, which is expected to reap zombie processes; since it doesn't, they get left around to take up room. This PR installs
tini
and uses it as PID 1, instead.I've removed the build/bin/{entrypoint,user_setup} scripts, which aren't necessary. The entry point can be given in the Dockerfile, and
useradd
already does the necessary setup. It is still necessary to create $HOME/.ssh, since git uses SSH and SSH expects that directory to exist.This also removes the extra ceremony around using ssh-agent. Very little explanation is given in #92 where it was added, so I did some investigation. It turns out that go-git will use SSH agent if not given any other auth. The automation API will supply auth to go-git as long as it's given something, but will otherwise let go-git fall back to using the ssh-agent.
The problem with falling back to ssh-agent is that it won't work inside the operator container -- even if you run ssh-agent, that will avoid go-git complaining about not finding its socket (which seems to have been the impetus for #92), but will then fail to authenticate because ssh-agent doesn't have any keys to offer. A better alternative is to explicitly require a secret key in
.spec.gitAuth
.