Skip to content

Commit b571ad7

Browse files
authored
Merge pull request #3387 from sbueringer/pr-log-version-on-startup
🌱 Log version directly on controller startup
2 parents 46e1326 + 21256c8 commit b571ad7

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

main.go

+2
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ func InitFlags(fs *pflag.FlagSet) {
240240
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vspheremachinetemplates;vsphereclustertemplates,verbs=get;list;watch;patch;update
241241

242242
func main() {
243+
setupLog.Info(fmt.Sprintf("Version: %+v", version.Get().String()))
244+
243245
InitFlags(pflag.CommandLine)
244246
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
245247
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)

test/extension/main.go

+3
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"
@@ -169,6 +170,8 @@ func InitFlags(fs *pflag.FlagSet) {
169170
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=create
170171

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

test/infrastructure/net-operator/main.go

+2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ func InitFlags(fs *pflag.FlagSet) {
137137
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=create
138138

139139
func main() {
140+
setupLog.Info(fmt.Sprintf("Version: %+v", version.Get().String()))
141+
140142
InitFlags(pflag.CommandLine)
141143
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
142144
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)

test/infrastructure/vcsim/main.go

+2
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ func InitFlags(fs *pflag.FlagSet) {
178178
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=create
179179

180180
func main() {
181+
setupLog.Info(fmt.Sprintf("Version: %+v", version.Get().String()))
182+
181183
InitFlags(pflag.CommandLine)
182184
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
183185
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)

0 commit comments

Comments
 (0)