Skip to content

Commit b98f5f7

Browse files
committed
Improve startup logs
Signed-off-by: Stefan Büringer [email protected]
1 parent 11917e9 commit b98f5f7

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

pkg/builder/webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ func (blder *WebhookBuilder) registerValidatingWebhook() {
132132
func (blder *WebhookBuilder) registerConversionWebhook() error {
133133
ok, err := conversion.IsConvertible(blder.mgr.GetScheme(), blder.apiType)
134134
if err != nil {
135-
log.Error(err, "conversion check failed", "object", blder.apiType)
135+
log.Error(err, "conversion check failed", "GVK", blder.gvk)
136136
return err
137137
}
138138
if ok {
139139
if !blder.isAlreadyHandled("/convert") {
140140
blder.mgr.GetWebhookServer().Register("/convert", &conversion.Webhook{})
141141
}
142-
log.Info("conversion webhook enabled", "object", blder.apiType)
142+
log.Info("Conversion webhook enabled", "GVK", blder.gvk)
143143
}
144144

145145
return nil

pkg/internal/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func (c *Controller) Start(ctx context.Context) error {
175175
// caches to sync so that they have a chance to register their intendeded
176176
// caches.
177177
for _, watch := range c.startWatches {
178-
c.Log.Info("Starting EventSource", "source", watch.src)
178+
c.Log.Info("Starting EventSource", "source", fmt.Sprintf("%s", watch.src))
179179

180180
if err := watch.src.Start(ctx, watch.handler, c.Queue, watch.predicates...); err != nil {
181181
return err

pkg/manager/internal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func (cm *controllerManager) serveMetrics() {
380380
}
381381
// Run the server
382382
cm.startRunnable(RunnableFunc(func(_ context.Context) error {
383-
cm.logger.Info("starting metrics server", "path", defaultMetricsEndpoint)
383+
cm.logger.Info("Starting metrics server", "path", defaultMetricsEndpoint)
384384
if err := server.Serve(cm.metricsListener); err != nil && err != http.ErrServerClosed {
385385
return err
386386
}

pkg/metrics/listener.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func NewListener(addr string) (net.Listener, error) {
4141
return nil, nil
4242
}
4343

44-
log.Info("metrics server is starting to listen", "addr", addr)
44+
log.Info("Metrics server is starting to listen", "addr", addr)
4545
ln, err := net.Listen("tcp", addr)
4646
if err != nil {
4747
er := fmt.Errorf("error listening on %s: %w", addr, err)

pkg/source/source.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ func (ks *Kind) Start(ctx context.Context, handler handler.EventHandler, queue w
142142
}
143143

144144
func (ks *Kind) String() string {
145-
if ks.Type != nil && ks.Type.GetObjectKind() != nil {
146-
return fmt.Sprintf("kind source: %v", ks.Type.GetObjectKind().GroupVersionKind().String())
145+
if ks.Type != nil {
146+
return fmt.Sprintf("kind source: %T", ks.Type)
147147
}
148-
return "kind source: unknown GVK"
148+
return "kind source: unknown type"
149149
}
150150

151151
// WaitForSync implements SyncingSource to allow controllers to wait with starting

pkg/webhook/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (s *Server) Register(path string, hook http.Handler) {
142142
s.WebhookMux.Handle(path, metrics.InstrumentedHook(path, hook))
143143

144144
regLog := log.WithValues("path", path)
145-
regLog.Info("registering webhook")
145+
regLog.Info("Registering webhook")
146146

147147
// we've already been "started", inject dependencies here.
148148
// Otherwise, InjectFunc will do this for us later.
@@ -210,7 +210,7 @@ func (s *Server) Start(ctx context.Context) error {
210210
s.defaultingOnce.Do(s.setDefaults)
211211

212212
baseHookLog := log.WithName("webhooks")
213-
baseHookLog.Info("starting webhook server")
213+
baseHookLog.Info("Starting webhook server")
214214

215215
certPath := filepath.Join(s.CertDir, s.CertName)
216216
keyPath := filepath.Join(s.CertDir, s.KeyName)
@@ -259,7 +259,7 @@ func (s *Server) Start(ctx context.Context) error {
259259
return err
260260
}
261261

262-
log.Info("serving webhook server", "host", s.Host, "port", s.Port)
262+
log.Info("Serving webhook server", "host", s.Host, "port", s.Port)
263263

264264
srv := &http.Server{
265265
Handler: s.WebhookMux,

0 commit comments

Comments
 (0)