Skip to content

Commit 089a0c3

Browse files
author
ivan
committed
fix the bug of create two namespace which one name is other name's substr, return error of more than 1.
1 parent 054fe32 commit 089a0c3

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
@@ -308,6 +308,13 @@ func (me *TCRService) DescribeTCRNameSpaceById(ctx context.Context, instanceId s
308308
if len(namespaces) == 0 {
309309
return nil, has, nil
310310
} else if len(namespaces) > 1 {
311+
for i := range namespaces {
312+
if name == *namespaces[i].Name {
313+
namespace = namespaces[i]
314+
has = true
315+
return
316+
}
317+
}
311318
errRet = fmt.Errorf("TencentCloud SDK return more than 1 namespaces, %s %s", instanceId, name)
312319
return
313320
}

0 commit comments

Comments
 (0)