Skip to content

Commit 270f665

Browse files
authored
Merge pull request #555 from jingxu97/July/msensitive
Add MountSensitive in CSIproxy mounter
2 parents 893f10e + d348942 commit 270f665

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ STAGINGIMAGE=${GCE_PD_CSI_STAGING_IMAGE}
2424
DRIVERBINARY=gce-pd-csi-driver
2525
DRIVERWINDOWSBINARY=${DRIVERBINARY}.exe
2626

27-
all: gce-pd-driver
27+
all: gce-pd-driver gce-pd-driver-windows
2828
gce-pd-driver:
2929
mkdir -p bin
3030
go build -mod=vendor -ldflags "-X main.vendorVersion=${STAGINGVERSION}" -o bin/${DRIVERBINARY} ./cmd/

hack/verify-all.sh

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ PKG_ROOT=$(git rev-parse --show-toplevel)
2222

2323
${PKG_ROOT}/hack/verify-gofmt.sh
2424
${PKG_ROOT}/hack/verify-govet.sh
25+
26+
make -C "${PKG_ROOT}" all

pkg/mount-manager/safe-mounter_windows.go

+9
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ func NewSafeMounter() (*mount.SafeFormatAndMount, error) {
7777

7878
// Mount just creates a soft link at target pointing to source.
7979
func (mounter *CSIProxyMounter) Mount(source string, target string, fstype string, options []string) error {
80+
return mounter.MountSensitive(source, target, fstype, options, nil /* sensitiveOptions */)
81+
}
82+
83+
// MountSensitive is the same as Mount() but this method allows
84+
// sensitiveOptions to be passed in a separate parameter from the normal
85+
// mount options and ensures the sensitiveOptions are never logged.
86+
// Since Mount here is just create a synlink, so options and sensitiveOptions
87+
// are not used here
88+
func (mounter *CSIProxyMounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
8089
// Mount is called after the format is done.
8190
// TODO: Confirm that fstype is empty.
8291
// Call the LinkPath CSI proxy from the source path to the target path

0 commit comments

Comments
 (0)