From b691cca6ff555c201a93467a3bf6348f9082747e Mon Sep 17 00:00:00 2001 From: Gireesh Naidu <111440205+gireesh-devtron@users.noreply.github.com> Date: Mon, 6 Nov 2023 19:34:58 +0530 Subject: [PATCH] setting cipipelineId to parent ci-pipelines id for linked ci's (#4215) --- pkg/dockerRegistry/DockerRegistryIpsConfigService.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/dockerRegistry/DockerRegistryIpsConfigService.go b/pkg/dockerRegistry/DockerRegistryIpsConfigService.go index 21aab227c1..564873b9ad 100644 --- a/pkg/dockerRegistry/DockerRegistryIpsConfigService.go +++ b/pkg/dockerRegistry/DockerRegistryIpsConfigService.go @@ -163,7 +163,11 @@ func (impl DockerRegistryIpsConfigServiceImpl) getDockerRegistryIdForCiPipeline( if ciPipeline.IsDockerConfigOverridden { //set dockerRegistryId value with the DockerRegistryId of the overridden dockerRegistry - ciTemplateOverride, err := impl.ciTemplateOverrideRepository.FindByCiPipelineId(ciPipelineId) + ciPipId := ciPipelineId + if ciPipeline.ParentCiPipeline != 0 { + ciPipId = ciPipeline.ParentCiPipeline + } + ciTemplateOverride, err := impl.ciTemplateOverrideRepository.FindByCiPipelineId(ciPipId) if err != nil { impl.logger.Errorw("error in getting ciTemplateOverride by ciPipelineId", "ciPipelineId", ciPipelineId, "error", err) return nil, err