diff --git a/pkg/agent/run.go b/pkg/agent/run.go index 091c9338..88d3772e 100644 --- a/pkg/agent/run.go +++ b/pkg/agent/run.go @@ -29,7 +29,6 @@ import ( clientgocorev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/record" "k8s.io/klog/v2" - "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/jetstack/preflight/api" "github.com/jetstack/preflight/pkg/client" @@ -141,15 +140,14 @@ func Run(cmd *cobra.Command, args []string) (returnErr error) { }) } - _, isVenConn := preflightClient.(*client.VenConnClient) + vcc, isVenConn := preflightClient.(*client.VenConnClient) if isVenConn { group.Go(func() error { - err := preflightClient.(manager.Runnable).Start(gctx) + err := vcc.Start(gctx) if err != nil { - return fmt.Errorf("failed to start a controller-runtime component: %v", err) + return fmt.Errorf("failed to start the VenConnClient: %v", err) } - - // The agent must stop if the controller-runtime component stops. + // The agent must stop if the venafi-connection-lib client stops. cancel() return nil }) diff --git a/pkg/logs/logs.go b/pkg/logs/logs.go index f2e6dd8f..bd8be765 100644 --- a/pkg/logs/logs.go +++ b/pkg/logs/logs.go @@ -133,7 +133,7 @@ func Initialize() error { // to the global log logger. It can be removed when this is fixed upstream // in vcert: https://github.com/Venafi/vcert/pull/512 vcertLog.SetPrefix("") - + klog.EnableContextualLogging(true) // The venafi-connection-lib client uses various controller-runtime packages // which emit log messages. Make sure those log messages are not discarded. ctrlruntimelog.SetLogger(klog.Background().WithValues("source", "controller-runtime"))