Skip to content

Commit 9cc90fb

Browse files
authored
fix: updated ValidateRegistryStorageType for OCI registry configs (#3634)
1 parent 373e784 commit 9cc90fb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg/pipeline/DockerRegistryConfig.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,18 @@ Returns:
132132
*/
133133
func (impl DockerRegistryConfigImpl) ValidateRegistryStorageType(registryId string, storageType string, storageActions ...string) bool {
134134
isValid := false
135-
ociRegistryConfigList, err := impl.ociRegistryConfigRepository.FindByDockerRegistryId(registryId)
135+
store, err := impl.dockerArtifactStoreRepository.FindOne(registryId)
136136
if err != nil {
137137
return false
138138
}
139-
for _, ociRegistryConfig := range ociRegistryConfigList {
140-
if ociRegistryConfig.RepositoryType == storageType && slices.Contains(storageActions, ociRegistryConfig.RepositoryAction) {
141-
isValid = true
139+
if store.IsOCICompliantRegistry {
140+
for _, ociRegistryConfig := range store.OCIRegistryConfig {
141+
if ociRegistryConfig.RepositoryType == storageType && slices.Contains(storageActions, ociRegistryConfig.RepositoryAction) {
142+
isValid = true
143+
}
142144
}
145+
} else {
146+
return true
143147
}
144148
return isValid
145149
}

0 commit comments

Comments
 (0)