mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rbd: modify stripSecret mechanism in logGRPC()
This commit updates csi-addons spec version and modifies logging to strip replication request secret using csi.StripSecret, then with replication.protosanitizer if the former fails. This is done in order to make sure we strip csi and replication format of secrets. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
@ -193,12 +193,18 @@ func logGRPC(
|
||||
handler grpc.UnaryHandler,
|
||||
) (interface{}, error) {
|
||||
log.ExtendedLog(ctx, "GRPC call: %s", info.FullMethod)
|
||||
// TODO: remove the following check for next release
|
||||
// refer to https://github.com/ceph/ceph-csi/issues/3314.
|
||||
if isReplicationRequest(req) {
|
||||
log.TraceLog(ctx, "GRPC request: %s", rp.StripReplicationSecrets(req))
|
||||
strippedMessage := protosanitizer.StripSecrets(req).String()
|
||||
if !strings.Contains(strippedMessage, "***stripped***") {
|
||||
strippedMessage = rp.StripReplicationSecrets(req).String()
|
||||
}
|
||||
|
||||
log.TraceLog(ctx, "GRPC request: %s", strippedMessage)
|
||||
} else {
|
||||
log.TraceLog(ctx, "GRPC request: %s", protosanitizer.StripSecrets(req))
|
||||
}
|
||||
|
||||
resp, err := handler(ctx, req)
|
||||
if err != nil {
|
||||
klog.Errorf(log.Log(ctx, "GRPC error: %v"), err)
|
||||
|
Reference in New Issue
Block a user