Skip to content

Commit 7dbf1df

Browse files
committed
nil handling
1 parent 758f179 commit 7dbf1df

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/app/AppListingService.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"github.com/devtron-labs/devtron/pkg/deployment/manifest/deployedAppMetrics"
3232
"github.com/devtron-labs/devtron/pkg/deployment/manifest/deploymentTemplate/read"
3333
"github.com/devtron-labs/devtron/pkg/dockerRegistry"
34+
"github.com/devtron-labs/devtron/pkg/pipeline/constants"
3435
util2 "github.com/devtron-labs/devtron/util"
3536
"github.com/devtron-labs/devtron/util/argo"
3637
errors2 "github.com/juju/errors"
@@ -784,6 +785,10 @@ func (impl AppListingServiceImpl) setIpAccessProvidedData(ctx context.Context, a
784785
}
785786

786787
if ciPipeline != nil && ciPipeline.CiTemplate != nil && len(*ciPipeline.CiTemplate.DockerRegistryId) > 0 {
788+
if !ciPipeline.IsExternal || ciPipeline.ParentCiPipeline != 0 && ciPipeline.PipelineType != string(constants.LINKED_CD) {
789+
appDetailContainer.IsExternalCi = false
790+
}
791+
// get dockerRegistryId starts
787792
artifact, err := impl.ciArtifactRepository.Get(appDetailContainer.CiArtifactId)
788793
if err != nil {
789794
impl.Logger.Errorw("error in fetching ci artifact", "ciArtifactId", appDetailContainer.CiArtifactId, "error", err)
@@ -794,13 +799,12 @@ func (impl AppListingServiceImpl) setIpAccessProvidedData(ctx context.Context, a
794799
impl.Logger.Errorw("error in fetching docker registry id", "ciPipelineId", ciPipelineId, "error", err)
795800
return bean.AppDetailContainer{}, err
796801
}
797-
if !ciPipeline.IsExternal || ciPipeline.ParentCiPipeline != 0 {
798-
appDetailContainer.IsExternalCi = false
799-
}
802+
800803
if dockerRegistryId == nil {
801804
impl.Logger.Errorw("docker registry id not found", "ciPipelineId", ciPipelineId)
802805
return appDetailContainer, nil
803806
}
807+
// get dockerRegistryId ends
804808
appDetailContainer.DockerRegistryId = *dockerRegistryId
805809

806810
_, span = otel.Tracer("orchestrator").Start(ctx, "dockerRegistryIpsConfigService.IsImagePullSecretAccessProvided")

0 commit comments

Comments
 (0)