修复镜像信息缓存污染问题

This commit is contained in:
user123456
2025-06-13 11:02:48 +08:00
parent 232260c1bf
commit 018a8235e2
2 changed files with 25 additions and 11 deletions

View File

@@ -78,6 +78,15 @@ func buildManifestCacheKey(imageRef, reference string) string {
return buildCacheKey("manifest", key)
}
// buildManifestCacheKeyWithPlatform 构建包含平台信息的manifest缓存key
func buildManifestCacheKeyWithPlatform(imageRef, reference, platform string) string {
if platform == "" {
platform = "default"
}
key := fmt.Sprintf("%s:%s@%s", imageRef, reference, platform)
return buildCacheKey("manifest", key)
}
// getManifestTTL 根据引用类型智能确定TTL
func getManifestTTL(reference string) time.Duration {
cfg := GetConfig()