8
8
9
9
"github.com/container-storage-interface/spec/lib/go/csi"
10
10
"github.com/containerd/containerd/reference/docker"
11
+ "github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
11
12
"github.com/warm-metal/container-image-csi-driver/pkg/backend"
12
13
"github.com/warm-metal/container-image-csi-driver/pkg/metrics"
13
14
"github.com/warm-metal/container-image-csi-driver/pkg/remoteimage"
@@ -17,6 +18,7 @@ import (
17
18
"google.golang.org/grpc/codes"
18
19
"google.golang.org/grpc/status"
19
20
cri "k8s.io/cri-api/pkg/apis/runtime/v1"
21
+
20
22
"k8s.io/klog/v2"
21
23
k8smount "k8s.io/mount-utils"
22
24
)
@@ -60,7 +62,7 @@ type NodeServer struct {
60
62
61
63
func (n NodeServer ) NodePublishVolume (ctx context.Context , req * csi.NodePublishVolumeRequest ) (resp * csi.NodePublishVolumeResponse , err error ) {
62
64
valuesLogger := klog .LoggerWithValues (klog .NewKlogr (), "pod-name" , req .VolumeContext ["pod-name" ], "namespace" , req .VolumeContext ["namespace" ], "uid" , req .VolumeContext ["uid" ])
63
- valuesLogger .Info ("Incoming NodePublishVolume request" , "request string" , req . String ( ))
65
+ valuesLogger .Info ("Incoming NodePublishVolume request" , "request string" , protosanitizer . StripSecrets ( req ))
64
66
if len (req .VolumeId ) == 0 {
65
67
err = status .Error (codes .InvalidArgument , "VolumeId is missing" )
66
68
return
@@ -173,13 +175,13 @@ func (n NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishV
173
175
return
174
176
}
175
177
176
- valuesLogger .Info ("Successfully completed NodePublishVolume request" , "request string" , req . String ( ))
178
+ valuesLogger .Info ("Successfully completed NodePublishVolume request" , "request string" , protosanitizer . StripSecrets ( req ))
177
179
178
180
return & csi.NodePublishVolumeResponse {}, nil
179
181
}
180
182
181
183
func (n NodeServer ) NodeUnpublishVolume (ctx context.Context , req * csi.NodeUnpublishVolumeRequest ) (resp * csi.NodeUnpublishVolumeResponse , err error ) {
182
- klog .Infof ("unmount request: %s" , req . String ( ))
184
+ klog .Infof ("unmount request: %s" , protosanitizer . StripSecrets ( req ))
183
185
if len (req .VolumeId ) == 0 {
184
186
err = status .Error (codes .InvalidArgument , "VolumeId is missing" )
185
187
return
0 commit comments