Skip to content

Commit

Permalink
Merge pull request #2156 from Nordix/remove-deprecated-modules/sunnat
Browse files Browse the repository at this point in the history
🌱 Removes depreacted klogr.New() and rand.Seed()
  • Loading branch information
metal3-io-bot authored Dec 19, 2024
2 parents a5a3fac + f9dc121 commit 4e67d9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/klog/v2/klogr"
"k8s.io/klog/v2"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
Expand Down Expand Up @@ -62,7 +62,7 @@ const (
)

func init() {
logf.SetLogger(klogr.New())
logf.SetLogger(klog.Background())

// Register required object kinds with global scheme.
_ = apiextensionsv1.AddToScheme(scheme.Scheme)
Expand Down
6 changes: 2 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"flag"
"fmt"
"math/rand"
"os"
"strconv"
"time"
Expand Down Expand Up @@ -48,7 +47,7 @@ import (
"k8s.io/component-base/logs"
logsv1 "k8s.io/component-base/logs/api/v1"
_ "k8s.io/component-base/logs/json/register"
"k8s.io/klog/v2/klogr"
"k8s.io/klog/v2"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/controllers/clustercache"
"sigs.k8s.io/cluster-api/controllers/remote"
Expand Down Expand Up @@ -114,7 +113,6 @@ func init() {
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=create

func main() {
rand.Seed(time.Now().UnixNano())
initFlags(pflag.CommandLine)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.Parse()
Expand All @@ -124,7 +122,7 @@ func main() {
os.Exit(1)
}

ctrl.SetLogger(klogr.New())
ctrl.SetLogger(klog.Background())
restConfig := ctrl.GetConfigOrDie()
restConfig.QPS = restConfigQPS
restConfig.Burst = restConfigBurst
Expand Down

0 comments on commit 4e67d9f

Please sign in to comment.