mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 02:57:37 +01:00
terraform/provider: do not adopt a bucket owned by another identity
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c2501f44c
commit
607f1c9d4b
2 files changed
+4
-1
No files matched your search
@@ -591,7 +591,7 @@ func isNoSuchBucketError(err error) bool {
|
||||
func isBucketAlreadyExistsError(err error) bool {
|
||||
var apiErr iamError
|
||||
if errors.As(err, &apiErr) {
|
||||
return apiErr.Code == "BucketAlreadyOwnedByYou" || apiErr.Code == "BucketAlreadyExists"
|
||||
return apiErr.Code == "BucketAlreadyOwnedByYou"
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -496,6 +496,9 @@ func TestIAMErrorHelpers(t *testing.T) {
|
||||
if !isEntityAlreadyExistsError(iamError{Code: "EntityAlreadyExists", Message: "exists"}) {
|
||||
t.Fatalf("expected EntityAlreadyExists helper to match")
|
||||
}
|
||||
if isBucketAlreadyExistsError(iamError{Code: "BucketAlreadyExists", Message: "taken"}) {
|
||||
t.Fatal("a bucket owned by another identity must not be adopted")
|
||||
}
|
||||
if !isBucketAlreadyExistsError(iamError{Code: "BucketAlreadyOwnedByYou", Message: "exists"}) {
|
||||
t.Fatalf("expected BucketAlreadyOwnedByYou helper to match")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user