Skip to content

Commit f2ef105

Browse files
committed
feat: fix delete replaction rustfs/rustfs#1198
1 parent 6d13d03 commit f2ef105

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

components/replication/new-form.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ const handleSave = async () => {
304304
305305
const targetResponse = await setRemoteReplicationTarget(props.bucketName, config)
306306
if (!targetResponse) {
307-
throw new Error('Failed to create replication target')
307+
// throw new Error('Failed to create replication target')
308+
return
308309
}
309310
310311
let oldConfig: any = null

pages/replication/index.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,16 @@ const handleRowDelete = async (rule: ReplicationRule) => {
177177
await deleteBucketReplication(bucketName.value as string)
178178
await deleteRemoteReplicationTarget(bucketName.value as string, rule.Destination?.Bucket ?? '')
179179
} else {
180+
// 获取当前配置以获取 Role 字段
181+
const currentConfig = await getBucketReplication(bucketName.value as string)
182+
const role = currentConfig?.ReplicationConfiguration?.Role
183+
184+
if (!role) {
185+
throw new Error('Replication configuration Role is missing')
186+
}
187+
180188
await putBucketReplication(bucketName.value as string, {
189+
Role: role,
181190
Rules: remaining,
182191
})
183192
}

0 commit comments

Comments
 (0)