Skip to content

Commit 054fe32

Browse files
author
ivan
committed
fix the bug that create two repository which one name is other name's substr, return error of more than 1. name in response is contains namespace, / and repositoryName
1 parent 8e41ec7 commit 054fe32

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tencentcloud/service_tencentcloud_tcr.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,13 @@ func (me *TCRService) DescribeTCRRepositoryById(ctx context.Context, instanceId
446446
if len(repositories) == 0 {
447447
return nil, has, nil
448448
} else if len(repositories) > 1 {
449+
for i := range repositories {
450+
if *repositories[i].Name == namespace+"/"+repositoryName {
451+
repository = repositories[i]
452+
has = true
453+
return
454+
}
455+
}
449456
errRet = fmt.Errorf("TencentCloud SDK return more than 1 namespaces, %s %s %s", instanceId, namespace, repositoryName)
450457
return
451458
}

0 commit comments

Comments
 (0)