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

Prow sub can work with GitHub app #24316

Merged
merged 1 commit into from
Nov 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions prow/cmd/sub/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ func main() {
if flagOptions.github.TokenPath != "" {
tokens = append(tokens, flagOptions.github.TokenPath)
}
if flagOptions.github.AppPrivateKeyPath != "" {
Copy link
Member

Choose a reason for hiding this comment

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

This shouldnt be needed, it happens in the flagutil when you call GitHubClientWithLogFields:

if err := secret.Add(o.AppPrivateKeyPath); err != nil {
return nil, fmt.Errorf("failed to add the the key from --app-private-key-path to secret agent: %w", err)
}

Below is another check for flagOptions.github.TokenPath , that one needs to also allow apps auth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah. right. that's strange then. I'll take another looks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

found it, fixing in #24317, and by the way removing duplicated logic in the PR

tokens = append(tokens, flagOptions.github.AppPrivateKeyPath)
}
if err := secret.Add(tokens...); err != nil {
logrus.WithError(err).Fatal("failed to start secret agent")
}
Expand Down