Add cmd line arg for enterprise url. Fix enterprise bug. (#1)

* Add cmd line arg for enterprise url. Fix enterprise bug.

* Fix package import order

* Fix comment
This commit is contained in:
Barun Mishra
2022-09-05 13:50:17 +01:00
committed by GitHub
parent 623c84fa52
commit 921daff61b
3 changed files with 9 additions and 6 deletions

View File

@@ -198,9 +198,8 @@ func (c *MultiGitHubClient) initClientForSecret(secret *corev1.Secret, dependent
return nil, err
}
// Check if EnterpriseURL is set.
if conf.EnterpriseURL == "" {
// fallback to the controller-wide setting
// Fallback to the controller-wide setting if EnterpriseURL is not set and the original client is an enterprise client.
if conf.EnterpriseURL == "" && c.githubClient.IsEnterprise {
conf.EnterpriseURL = c.githubClient.GithubBaseURL
}