Skip to content

Commit 10dbd73

Browse files
committed
Scrub Secret information in logGRPC()
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
1 parent ff3d3a8 commit 10dbd73

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/connection/connection.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
"github.com/container-storage-interface/spec/lib/go/csi/v0"
2727
"github.com/golang/glog"
28+
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
2829
"google.golang.org/grpc"
2930
"google.golang.org/grpc/codes"
3031
"google.golang.org/grpc/connectivity"
@@ -233,9 +234,9 @@ func (c *csiConnection) Close() error {
233234

234235
func logGRPC(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
235236
glog.V(5).Infof("GRPC call: %s", method)
236-
glog.V(5).Infof("GRPC request: %+v", req)
237+
glog.V(5).Infof("GRPC request: %s", protosanitizer.StripSecretsCSI03(req))
237238
err := invoker(ctx, method, req, reply, cc, opts...)
238-
glog.V(5).Infof("GRPC response: %+v", reply)
239+
glog.V(5).Infof("GRPC response: %s", protosanitizer.StripSecretsCSI03(reply))
239240
glog.V(5).Infof("GRPC error: %v", err)
240241
return err
241242
}

0 commit comments

Comments
 (0)