Skip to content

Commit a7eae04

Browse files
committed
Try and get the right logger to vencon
Signed-off-by: Richard Wall <[email protected]>
1 parent 124fe29 commit a7eae04

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pkg/agent/run.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
clientgocorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
3030
"k8s.io/client-go/tools/record"
3131
"k8s.io/klog/v2"
32-
"sigs.k8s.io/controller-runtime/pkg/manager"
3332

3433
"github.com/jetstack/preflight/api"
3534
"github.com/jetstack/preflight/pkg/client"
@@ -141,15 +140,14 @@ func Run(cmd *cobra.Command, args []string) (returnErr error) {
141140
})
142141
}
143142

144-
_, isVenConn := preflightClient.(*client.VenConnClient)
143+
vcc, isVenConn := preflightClient.(*client.VenConnClient)
145144
if isVenConn {
146145
group.Go(func() error {
147-
err := preflightClient.(manager.Runnable).Start(gctx)
146+
err := vcc.Start(gctx)
148147
if err != nil {
149-
return fmt.Errorf("failed to start a controller-runtime component: %v", err)
148+
return fmt.Errorf("failed to start the VenConnClient: %v", err)
150149
}
151-
152-
// The agent must stop if the controller-runtime component stops.
150+
// The agent must stop if the venafi-connection-lib client stops.
153151
cancel()
154152
return nil
155153
})

pkg/logs/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func Initialize() error {
133133
// to the global log logger. It can be removed when this is fixed upstream
134134
// in vcert: https://github.com/Venafi/vcert/pull/512
135135
vcertLog.SetPrefix("")
136-
136+
klog.EnableContextualLogging(true)
137137
// The venafi-connection-lib client uses various controller-runtime packages
138138
// which emit log messages. Make sure those log messages are not discarded.
139139
ctrlruntimelog.SetLogger(klog.Background().WithValues("source", "controller-runtime"))

0 commit comments

Comments
 (0)