mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
4bdd45c0cc
* refactor: introduce cmd internal package Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * changelog Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * informer Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * tracing Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix flag Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
21 lines
413 B
Go
21 lines
413 B
Go
package internal
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/go-logr/logr"
|
|
"go.uber.org/automaxprocs/maxprocs"
|
|
)
|
|
|
|
func SetupMaxProcs(logger logr.Logger) func() {
|
|
logger = logger.WithName("maxprocs")
|
|
undo, err := maxprocs.Set(
|
|
maxprocs.Logger(
|
|
func(format string, args ...interface{}) {
|
|
logger.Info(fmt.Sprintf(format, args...))
|
|
},
|
|
),
|
|
)
|
|
checkError(logger, err, "failed to configure maxprocs")
|
|
return undo
|
|
}
|