File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -54,22 +54,24 @@ import (
54
54
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
55
55
)
56
56
57
+ var log = logf.Log.WithName("cmd")
58
+
57
59
func printVersion() {
58
- logf.Log .Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
59
- logf.Log .Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
60
- logf.Log .Info(fmt.Sprintf("operator-sdk Version: %v", sdkVersion.Version))
60
+ log .Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
61
+ log .Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
62
+ log .Info(fmt.Sprintf("operator-sdk Version: %v", sdkVersion.Version))
61
63
}
62
64
63
65
func main() {
64
- printVersion()
65
66
flag.Parse()
66
67
67
68
// The logger instantiated here can be changed to any logger
68
69
// implementing the logr.Logger interface. This logger will
69
70
// be propagated through the whole operator, generating
70
71
// uniform and structured logs.
71
72
logf.SetLogger(logf.ZapLogger(false))
72
- log := logf.Log.WithName("cmd")
73
+
74
+ printVersion()
73
75
74
76
namespace, err := k8sutil.GetWatchNamespace()
75
77
if err != nil {
Original file line number Diff line number Diff line change @@ -52,22 +52,24 @@ import (
52
52
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
53
53
)
54
54
55
+ var log = logf.Log.WithName("cmd")
56
+
55
57
func printVersion() {
56
- logf.Log .Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
57
- logf.Log .Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
58
- logf.Log .Info(fmt.Sprintf("operator-sdk Version: %v", sdkVersion.Version))
58
+ log .Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
59
+ log .Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
60
+ log .Info(fmt.Sprintf("operator-sdk Version: %v", sdkVersion.Version))
59
61
}
60
62
61
63
func main() {
62
- printVersion()
63
64
flag.Parse()
64
65
65
66
// The logger instantiated here can be changed to any logger
66
67
// implementing the logr.Logger interface. This logger will
67
68
// be propagated through the whole operator, generating
68
69
// uniform and structured logs.
69
70
logf.SetLogger(logf.ZapLogger(false))
70
- log := logf.Log.WithName("cmd")
71
+
72
+ printVersion()
71
73
72
74
namespace, err := k8sutil.GetWatchNamespace()
73
75
if err != nil {
You can’t perform that action at this time.
0 commit comments