fix: configure logger before trying to log (#1128)

Log about GitHub client not being initialized is not seen as logger is configured after adding the log
This commit is contained in:
Felipe Galindo Sanchez 2022-02-19 03:56:58 -08:00 committed by GitHub
parent a9aea0bd9c
commit 9079c5d85f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -144,6 +144,8 @@ func main() {
}
})
ctrl.SetLogger(logger)
// In order to support runner groups with custom visibility (selected repositories), we need to perform some GitHub API calls.
// Let the user define if they want to opt-in supporting this option by providing the proper GitHub authentication parameters
// Without an opt-in, runner groups with custom visibility won't be supported to save API calls
@ -160,8 +162,6 @@ func main() {
setupLog.Info("GitHub client is not initialized. Runner groups with custom visibility are not supported. If needed, please provide GitHub authentication. This will incur in extra GitHub API calls")
}
ctrl.SetLogger(logger)
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
SyncPeriod: &syncPeriod,