Skip to content

Commit 9e46576

Browse files
committed
add
1 parent d7a9992 commit 9e46576

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tencentcloud/services/cos/resource_tc_cos_bucket.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,14 @@ func ACLBodyDiffFunc(olds, news string, d *schema.ResourceData) (result bool) {
18871887
}
18881888

18891889
// diff: ACL element
1890-
for _, oldGrantee := range oldRoot.FindElements("//Grantee") {
1890+
oldGrantees := oldRoot.FindElements("//Grantee")
1891+
newGrantees := newRoot.FindElements("//Grantee")
1892+
// check count
1893+
if len(oldGrantees) != len(newGrantees) {
1894+
return false
1895+
}
1896+
// check content
1897+
for _, oldGrantee := range oldGrantees {
18911898
for _, attr := range oldGrantee.Attr {
18921899
if attr.Key != "type" {
18931900
// only need to handle the type attribute
@@ -1959,7 +1966,9 @@ func ACLBodyDiffFunc(olds, news string, d *schema.ResourceData) (result bool) {
19591966
uid = oldGranteeURI.Text()
19601967
}
19611968
log.Printf("[DEBUG] diff verification passed for grantee:[%s:%s]\n", oldGranteeType, uid)
1962-
break
1969+
}
1970+
if !result {
1971+
return false
19631972
}
19641973
}
19651974
}

0 commit comments

Comments
 (0)