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

krel release-notes with --create-website-pr errors with git ssh fingerprint #2420

Closed
csantanapr opened this issue Feb 9, 2022 · 2 comments · Fixed by #2421
Closed

krel release-notes with --create-website-pr errors with git ssh fingerprint #2420

csantanapr opened this issue Feb 9, 2022 · 2 comments · Fixed by #2421
Assignees
Labels
area/release-eng Issues or PRs related to the Release Engineering subproject kind/bug Categorizes issue or PR as related to a bug. needs-priority sig/release Categorizes an issue or PR as relevant to SIG Release.

Comments

@csantanapr
Copy link
Member

What happened:

Trying to generate the PRs to update the website https://kubernetes.io/releases/ with missing release notes for patch releases.

Running the command

krel release-notes --fix --fork csantanapr --tag v1.22.1 --list-v2 --create-website-pr --log-level trace

Noticed I'm only using the flag --create-website-pr
If you using both flags --create-draft-pr and --create-website-pr it works because the git clone will be done with https (create-draft-pr) and the create-website function will skip the git clone using ssh

Here is the background on the problem go-git/go-git#411

I proposed we switch to https cloning since for k/k, this is consistence and it always works

What you expected to happen:

To not have errors and creates the PR

How to reproduce it (as minimally and precisely as possible):

  • Create rsa private key pair for github
  • Setup known hosts file
  • Run the command
krel release-notes --fix --fork csantanapr --tag v1.22.1 --list-v2 --create-website-pr --log-level trace

Anything else we need to know?:

❯ krel release-notes --fix --fork csantanapr --tag v1.23.1 --list-v2 --create-website-pr
INFO Checking if a PR can be created from csantanapr/release-notes
Create website pull request? (Y/n) (1/10)
y
INFO Generating release notes for tag v1.23.1
INFO Cloning kubernetes/sig-release to read mapping files
INFO Cloning kubernetes/kubernetes
ERRO Clone repository failed. Tracked progress:
FATA creating website PR: generating release notes in JSON format: cloning default github repo: unable to clone repo: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

It errors with git ssh problems like this. Notice that is trying to git clone with ssh git clone git@github.com/kubernetes/kubernetes
DEBU Using repository url "git@github.com:kubernetes/kubernetes" file="git/git.go:371

I have a private ssh key in ~/.ssh/id_rsa
And have the correct known_hosts

ssh-keyscan github.com > ~/.ssh/known_hosts
``
I'm able to git clone using `git`

git clone git@github.com/kubernetes/kubernetes

I can even test the ssh connection

$ ssh -T git@github.com
Hi mojotx! You've successfully authenticated, but GitHub does not provide shell access.

#### Environment:

- OS (e.g: `cat /etc/os-release`): MacOS and Ubuntu

@csantanapr csantanapr added area/release-eng Issues or PRs related to the Release Engineering subproject kind/bug Categorizes issue or PR as related to a bug. sig/release Categorizes an issue or PR as relevant to SIG Release. labels Feb 9, 2022
@csantanapr
Copy link
Member Author

/assign

@csantanapr
Copy link
Member Author

csantanapr commented Feb 10, 2022

Found the fix for this if you can to get krel release-notes to work with git ssh

Add your private key to SSH Agent, even if you don't have a passphrase or even if you're using MacOS and git clone is working ssh.

ssh-add ~/.ssh/<id_ed25519 or id_rsa or privatekey_to_use_for_github_dot_com>

cc @puerco

We could add this requirement in the docs in addition of getting a GITHUB_TOKEN to configure ssh access to github.com, but I would prefer to be consistent and do not add the extra prereq.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/release-eng Issues or PRs related to the Release Engineering subproject kind/bug Categorizes issue or PR as related to a bug. needs-priority sig/release Categorizes an issue or PR as relevant to SIG Release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants