Skip to content

Commit

Permalink
Upstream: 677: Init klog in manager properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ingvagabund committed Jan 15, 2019
1 parent 97771a0 commit f8f0544
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
41 changes: 41 additions & 0 deletions 0001-Upstream-677-Init-klog-in-manager-properly.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 6376c57e840a5ff57217ead3dd2633ee00c08d07 Mon Sep 17 00:00:00 2001
From: Jan Chaloupka <[email protected]>
Date: Tue, 15 Jan 2019 10:28:40 +0100
Subject: [PATCH] Upstream: 677: Init klog in manager properly

---
vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go b/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go
index 6c53802..6082803 100644
--- a/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go
+++ b/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go
@@ -22,6 +22,7 @@ import (
"flag"

_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
+ "k8s.io/klog"
"sigs.k8s.io/cluster-api/pkg/apis"
"sigs.k8s.io/cluster-api/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/client/config"
@@ -30,7 +31,16 @@ import (
)

func main() {
+ klogFlags := flag.NewFlagSet("klog", flag.ExitOnError)
+ klog.InitFlags(klogFlags)
flag.Parse()
+ flag.VisitAll(func(f1 *flag.Flag) {
+ f2 := klogFlags.Lookup(f1.Name)
+ if f2 != nil {
+ value := f1.Value.String()
+ f2.Value.Set(value)
+ }
+ })

// Get a config to talk to the apiserver
cfg, err := config.GetConfig()
--
2.7.5

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ vendor:
patch -p1 < 0001-Delete-annotated-machines-first-when-scaling-down.patch
patch -p1 < 0002-Sort-machines-before-syncing.patch
patch -p1 < 0001-Validate-machineset-before-reconciliation.patch
patch -p1 < 0001-Upstream-677-Init-klog-in-manager-properly.patch

.PHONY: generate
generate:
Expand Down
10 changes: 10 additions & 0 deletions vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f8f0544

Please sign in to comment.