-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure controller-runtime to log with klog (#626)
Signed-off-by: Richard Wall <[email protected]>
- Loading branch information
Showing
3 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ authentication: | |
|
||
extraArgs: | ||
- --logging-format=json | ||
- --log-level=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ import ( | |
"net/http" | ||
"time" | ||
|
||
"github.com/go-logr/logr" | ||
venapi "github.com/jetstack/venafi-connection-lib/api/v1alpha1" | ||
Check failure on line 15 in pkg/client/client_venconn.go GitHub Actions / govulncheck
|
||
"github.com/jetstack/venafi-connection-lib/venafi_client" | ||
"github.com/jetstack/venafi-connection-lib/venafi_client/auth" | ||
|
@@ -22,7 +21,6 @@ import ( | |
"k8s.io/apimachinery/pkg/types" | ||
"k8s.io/client-go/rest" | ||
"sigs.k8s.io/controller-runtime/pkg/client/apiutil" | ||
ctrlruntimelog "sigs.k8s.io/controller-runtime/pkg/log" | ||
|
||
"github.com/jetstack/preflight/api" | ||
"github.com/jetstack/preflight/pkg/version" | ||
|
@@ -57,11 +55,6 @@ type VenConnClient struct { | |
// `restcfg` is not mutated. `trustedCAs` is only used for connecting to Venafi | ||
// Cloud and Vault and can be left nil. | ||
func NewVenConnClient(restcfg *rest.Config, agentMetadata *api.AgentMetadata, installNS, venConnName, venConnNS string, trustedCAs *x509.CertPool, disableCompression bool) (*VenConnClient, error) { | ||
// TODO(mael): The rest of the codebase uses the standard "log" package, | ||
// venafi-connection-lib uses "go-logr/logr", and client-go uses "klog". We | ||
// should standardize on one of them, probably "slog". | ||
ctrlruntimelog.SetLogger(logr.Logger{}) | ||
|
||
if installNS == "" { | ||
return nil, errors.New("programmer mistake: installNS must be provided") | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters