Skip to content

Commit

Permalink
Rename setupLog with log
Browse files Browse the repository at this point in the history
Signed-off-by: tenzen-y <[email protected]>
  • Loading branch information
tenzen-y committed Jan 23, 2024
1 parent 7b60752 commit 27ab24f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions pkg/controller/jobframework/jobframework.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ var (

func SetupControllers(
mgr ctrl.Manager,
setupLog logr.Logger,
log logr.Logger,
modifyOpts modifyOptions,
certsReady chan struct{},
opts ...Option,
) error {
// The controllers won't work until the webhooks are operating, and the webhook won't work until the
// certs are all in place.
cert.WaitForCertsReady(setupLog, certsReady)
cert.WaitForCertsReady(log, certsReady)
options := DefaultOptions
for _, opt := range opts {
opt(&options)
}

return ForEachIntegration(func(name string, cb IntegrationCallbacks) error {
log := setupLog.WithValues("jobFrameworkName", name)
logger := log.WithValues("jobFrameworkName", name)
fwkNamePrefix := fmt.Sprintf("jobFrameworkName %q", name)

if options.EnabledFrameworks.Has(name) {
Expand All @@ -65,7 +65,7 @@ func SetupControllers(
if !meta.IsNoMatchError(err) {
return fmt.Errorf("%s: %w", fwkNamePrefix, err)
}
log.Info("No matching API in the server for job framework, skipped setup of controller and webhook")
logger.Info("No matching API in the server for job framework, skipped setup of controller and webhook")
} else {
if err = cb.NewReconciler(
mgr.GetClient(),
Expand All @@ -82,7 +82,7 @@ func SetupControllers(
if err = cb.SetupWebhook(mgr, opts...); err != nil {
return fmt.Errorf("%s: unable to create webhook: %w", fwkNamePrefix, err)
}
log.Info("Set up controller and webhook for job framework")
logger.Info("Set up controller and webhook for job framework")
return nil
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/ptr"

"sigs.k8s.io/controller-runtime/pkg/client"
configapi "sigs.k8s.io/kueue/apis/config/v1beta1"

configapi "sigs.k8s.io/kueue/apis/config/v1beta1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
Expand Down

0 comments on commit 27ab24f

Please sign in to comment.