-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix(e2e): wait for SSH key and config in git auth test #9249
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
base: main
Are you sure you want to change the base?
fix(e2e): wait for SSH key and config in git auth test #9249
Conversation
|
/kind flake |
- Wait for both private key and SSH config files before git operations - Entrypoint copies credentials asynchronously from /tekton/creds to $HOME - Without config file, SSH doesn't know to use non-standard key name - Resolves "Failed password" errors from incomplete credential copy Signed-off-by: Vincent Demeester <[email protected]>
ff8db0b to
42f6aef
Compare
|
Thanks for catching that @waveywaves! You're absolutely right - the timeout calculation was off. Fixed in the latest commit by changing |
waveywaves
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: waveywaves The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
This PR fixes an intermittent flake in the
authenticating-git-commandse2e test that occurs with Kubernetes native sidecar support.Problem
The test was experiencing intermittent "Permission denied (publickey)" failures when attempting git clone operations. Analysis of the failure logs revealed:
Root Cause
The entrypoint's
CopyCredsToHome()function recursively copies credentials from/tekton/creds/.ssh/to$HOME/.ssh/file-by-file:id_ssh-key-for-git(private key)config(SSH config pointing to the key)known_hosts(if present in secret)The race condition: The script started executing while the file-by-file copy was still in progress. When the script ran
git clone, SSH couldn't find theconfigfile that tells it to use the non-standard key nameid_ssh-key-for-git. Without this config, SSH tried default key names, found nothing, and fell back to password authentication, which failed.Solution
Add a wait loop that explicitly checks for both required files (
id_ssh-key-for-gitANDconfig) before proceeding with git operations:This ensures SSH has everything it needs for authentication before attempting git clone.
Testing
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep/kind flakeafter creationRelease Notes