Skip to content

Commit 20d2337

Browse files
sbueringercprivitere
authored andcommitted
Log version on controller startup
Signed-off-by: Stefan Büringer buringerst@vmware.com
1 parent 76ed22d commit 20d2337

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

bootstrap/kubeadm/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ func InitFlags(fs *pflag.FlagSet) {
195195
// +kubebuilder:rbac:groups=bootstrap.cluster.x-k8s.io,resources=kubeadmconfigtemplates,verbs=get;list;watch;patch;update
196196

197197
func main() {
198+
setupLog.Info(fmt.Sprintf("Version: %+v", version.Get().String()))
199+
198200
InitFlags(pflag.CommandLine)
199201
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
200202
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)

controlplane/kubeadm/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ func InitFlags(fs *pflag.FlagSet) {
203203
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions;customresourcedefinitions/status,verbs=update;patch,resourceNames=kubeadmcontrolplanes.controlplane.cluster.x-k8s.io;kubeadmcontrolplanetemplates.controlplane.cluster.x-k8s.io
204204

205205
func main() {
206+
setupLog.Info(fmt.Sprintf("Version: %+v", version.Get().String()))
207+
206208
InitFlags(pflag.CommandLine)
207209
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
208210
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)

main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ func InitFlags(fs *pflag.FlagSet) {
287287
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machinedrainrules,verbs=get;list;watch;patch;update
288288

289289
func main() {
290+
setupLog.Info(fmt.Sprintf("Version: %+v", version.Get().String()))
291+
290292
InitFlags(pflag.CommandLine)
291293
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
292294
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)

test/extension/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package main
2323
import (
2424
"context"
2525
"flag"
26+
"fmt"
2627
"os"
2728
goruntime "runtime"
2829
"time"
@@ -170,6 +171,8 @@ func InitFlags(fs *pflag.FlagSet) {
170171
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=create
171172

172173
func main() {
174+
setupLog.Info(fmt.Sprintf("Version: %+v", version.Get().String()))
175+
173176
// Initialize and parse command line flags.
174177
InitFlags(pflag.CommandLine)
175178
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)

test/infrastructure/docker/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ func InitFlags(fs *pflag.FlagSet) {
208208
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=devclustertemplates;devmachinetemplates,verbs=get;list;watch;patch;update
209209

210210
func main() {
211+
setupLog.Info(fmt.Sprintf("Version: %+v", version.Get().String()))
212+
211213
if _, err := os.ReadDir("/tmp/"); err != nil {
212214
setupLog.Error(err, "Unable to start manager")
213215
os.Exit(1)

0 commit comments

Comments
 (0)