Skip to content

Commit 431c71b

Browse files
committed
fix start bos by sts
1 parent d307c20 commit 431c71b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/fs/client/ufs/object.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,7 @@ func NewObjectFileSystem(properties map[string]interface{}) (UnderFileStorage, e
13371337
}()
13381338
storage = object.NewBosClient(bucket, bosClient, true)
13391339
} else {
1340+
startBySts := false
13401341
log.Infof("init bos")
13411342
clientConfig := bos.BosClientConfiguration{
13421343
Ak: accessKey,
@@ -1361,8 +1362,9 @@ func NewObjectFileSystem(properties map[string]interface{}) (UnderFileStorage, e
13611362
return nil, err
13621363
}
13631364
bosClient.Config.Credentials = stsCredential
1365+
startBySts = true
13641366
}
1365-
storage = object.NewBosClient(bucket, bosClient, false)
1367+
storage = object.NewBosClient(bucket, bosClient, startBySts)
13661368
}
13671369
default:
13681370
panic("object storage not found")

pkg/fs/client/ufs/object_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func TestSTS(t *testing.T) {
7373
properties[fsCommon.Group] = "root-group"
7474
properties[fsCommon.Owner] = "root"
7575
properties[fsCommon.StsServer] = "127.0.0.1:8999"
76+
properties[fsCommon.BosSessionToken] = "token"
7677

7778
_, err := NewObjectFileSystem(properties)
7879
assert.NotNil(t, err, nil)

0 commit comments

Comments
 (0)