diff --git a/cmd/noderesourcetopology-plugin/main.go b/cmd/noderesourcetopology-plugin/main.go index efaa9ba74..6d8d3da98 100644 --- a/cmd/noderesourcetopology-plugin/main.go +++ b/cmd/noderesourcetopology-plugin/main.go @@ -21,8 +21,11 @@ import ( "os" "time" + "github.com/go-logr/logr" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/component-base/logs" + "k8s.io/component-base/version" "k8s.io/klog/v2/klogr" "k8s.io/kubernetes/cmd/kube-scheduler/app" @@ -37,12 +40,13 @@ import ( ) func main() { + logh := klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)) + printVersion(logh) // this must be the first thing logged ever. Note: we can't use V() yet - no flags parsed + utilfeature.DefaultMutableFeatureGate.SetFromMap(knifeatures.Desired()) rand.Seed(time.Now().UnixNano()) - logh := klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)) - knistatus.Setup(logh) // Register custom plugins to the scheduler framework. @@ -64,3 +68,8 @@ func main() { os.Exit(1) } } + +func printVersion(logh logr.Logger) { + ver := version.Get() + logh.Info("starting noderesourcetopology scheduler", "version", ver.GitVersion, "goversion", ver.GoVersion, "platform", ver.Platform) +}