Skip to content

Commit 12071cc

Browse files
committed
fix rotate path
1 parent 4eb3260 commit 12071cc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pkg/mounter/proxy/server/ossfs/driver.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"os"
88
"os/exec"
9+
"path/filepath"
910
"sync"
1011
"syscall"
1112
"time"
@@ -152,7 +153,8 @@ func (h *Driver) RotateToken(ctx context.Context, req *proxy.RotateTokenRequest)
152153

153154
// prepare passwd file
154155
hashDir := utils.GetPasswdHashDir(req.Target)
155-
rotated, err := rotateTokenFiles(hashDir, req.Secrets)
156+
tokenDir := filepath.Join(hashDir, utils.GetPasswdFileName("ossfs"))
157+
rotated, err := rotateTokenFiles(tokenDir, req.Secrets)
156158
if err != nil {
157159
return fmt.Errorf("rotate token files failed: %w", err)
158160
}

pkg/mounter/proxy/server/ossfs2/driver.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"os"
88
"os/exec"
9+
"path/filepath"
910
"sync"
1011
"syscall"
1112
"time"
@@ -159,7 +160,8 @@ func (h *Driver) RotateToken(ctx context.Context, req *proxy.RotateTokenRequest)
159160

160161
// prepare passwd file
161162
hashDir := utils.GetPasswdHashDir(req.Target)
162-
rotated, err := rotateTokenFiles(hashDir, req.Secrets)
163+
tokenDir := filepath.Join(hashDir, utils.GetPasswdFileName("ossfs2"))
164+
rotated, err := rotateTokenFiles(tokenDir, req.Secrets)
163165
if err != nil {
164166
return fmt.Errorf("rotate token files failed: %w", err)
165167
}

0 commit comments

Comments
 (0)