You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RFC-007] Implement GitHub app authentication for git repositories in IAC
- Controller change to use the GitHub authentication information specified in Git Repository's `.spec.secretRef` to create the auth options to authenticate to git repositories when the `provider` field is set to `github`,
- Tests for new `github` provider field in IAC
- Updated docs to use GitHub Apps for authentication in image-automation-controller.
Signed-off-by: Dipti Pai <[email protected]>
// if provider is github, but secret ref is not specified
195
+
ifrepo.Spec.SecretRef==nil {
196
+
returnnil, fmt.Errorf("secretRef with github app data must be specified when provider is set to github: %w", ErrInvalidSourceConfiguration)
197
+
}
198
+
opts.ProviderOpts=&git.ProviderOptions{
199
+
Name: sourcev1.GitProviderGitHub,
200
+
GitHubOpts: []github.OptFunc{
201
+
github.WithAppData(data),
202
+
},
203
+
}
204
+
default:
205
+
// analyze secret, if it has github app data, perhaps provider should have been github.
206
+
ifappID:=data[github.AppIDKey]; len(appID) !=0 {
207
+
returnnil, fmt.Errorf("secretRef '%s/%s' has github app data but provider is not set to github: %w", repo.GetNamespace(), repo.Spec.SecretRef.Name, ErrInvalidSourceConfiguration)
0 commit comments