Skip to content

Commit

Permalink
fix: configure logger before trying to log (actions#1128)
Browse files Browse the repository at this point in the history
Log about GitHub client not being initialized is not seen as logger is configured after adding the log
  • Loading branch information
fgalind1 authored Feb 19, 2022
1 parent a9aea0b commit 9079c5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/githubwebhookserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 9079c5d

Please sign in to comment.