Skip to content

Commit

Permalink
Scrub Secret information in logGRPC()
Browse files Browse the repository at this point in the history
Signed-off-by: Jose A. Rivera <[email protected]>
  • Loading branch information
jarrpa committed Dec 19, 2018
1 parent 38d2ea5 commit d97802e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/golang/glog"
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/connectivity"
Expand Down Expand Up @@ -134,9 +135,9 @@ func (c *csiConnection) Close() error {

func logGRPC(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
glog.V(5).Infof("GRPC call: %s", method)
glog.V(5).Infof("GRPC request: %+v", req)
glog.V(5).Infof("GRPC request: %s", protosanitizer.StripSecretsCSI03(req))
err := invoker(ctx, method, req, reply, cc, opts...)
glog.V(5).Infof("GRPC response: %+v", reply)
glog.V(5).Infof("GRPC response: %s", protosanitizer.StripSecretsCSI03(reply))
glog.V(5).Infof("GRPC error: %v", err)
return err
}
Expand Down

0 comments on commit d97802e

Please sign in to comment.