From 20213980fbc90637fc6041ebfbf8d9b53cc3e057 Mon Sep 17 00:00:00 2001 From: ericwu Date: Thu, 26 Oct 2023 18:40:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20oci=E4=BB=93=E5=BA=93=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E4=B8=8D=E5=8C=85=E5=90=AB=E8=B7=AF=E5=BE=84=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E6=BA=90=E5=9C=B0=E5=9D=80=E6=97=B6=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=80=9A=E8=BF=87=E9=89=B4=E6=9D=83=20#1342?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oci/artifact/repository/OciRegistryRemoteRepository.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/backend/oci/biz-oci/src/main/kotlin/com/tencent/bkrepo/oci/artifact/repository/OciRegistryRemoteRepository.kt b/src/backend/oci/biz-oci/src/main/kotlin/com/tencent/bkrepo/oci/artifact/repository/OciRegistryRemoteRepository.kt index 8a6833e65b..0991892b88 100644 --- a/src/backend/oci/biz-oci/src/main/kotlin/com/tencent/bkrepo/oci/artifact/repository/OciRegistryRemoteRepository.kt +++ b/src/backend/oci/biz-oci/src/main/kotlin/com/tencent/bkrepo/oci/artifact/repository/OciRegistryRemoteRepository.kt @@ -399,11 +399,10 @@ class OciRegistryRemoteRepository( } } - private fun getScope(remoteUrl: String, imageName: String): String { val baseUrl = URL(remoteUrl) - val target = baseUrl.path.removePrefix(StringPool.SLASH) - .removeSuffix(StringPool.SLASH) + StringPool.SLASH + imageName + val path = baseUrl.path.removePrefix(StringPool.SLASH).removeSuffix(StringPool.SLASH) + val target = if (path.isBlank()) imageName else path + StringPool.SLASH + imageName return "repository:$target:pull" }