-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from ingvagabund/klog-glog
Initialize klog alongside with glog
- Loading branch information
Showing
4 changed files
with
125 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
From f8f05443cf2774f22484fda02a5edac4a1251713 Mon Sep 17 00:00:00 2001 | ||
From: Jan Chaloupka <jchaloup@redhat.com> | ||
Date: Tue, 15 Jan 2019 10:28:40 +0100 | ||
Subject: [PATCH 1/3] Upstream: 677: Init klog in manager properly | ||
|
||
--- | ||
...pstream-677-Init-klog-in-manager-properly.patch | 41 ++++++++++++++++++++++ | ||
Makefile | 1 + | ||
vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go | 10 ++++++ | ||
3 files changed, 52 insertions(+) | ||
create mode 100644 0001-Upstream-677-Init-klog-in-manager-properly.patch | ||
|
||
diff --git a/0001-Upstream-677-Init-klog-in-manager-properly.patch b/0001-Upstream-677-Init-klog-in-manager-properly.patch | ||
new file mode 100644 | ||
index 0000000..dca0f54 | ||
--- /dev/null | ||
+++ b/0001-Upstream-677-Init-klog-in-manager-properly.patch | ||
@@ -0,0 +1,41 @@ | ||
+From 6376c57e840a5ff57217ead3dd2633ee00c08d07 Mon Sep 17 00:00:00 2001 | ||
+From: Jan Chaloupka <jchaloup@redhat.com> | ||
+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 | ||
+ | ||
diff --git a/Makefile b/Makefile | ||
index 142c6ca..330c662 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -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: | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.