Skip to content

Commit 4036b8d

Browse files
committed
minor fix
1 parent 91620ac commit 4036b8d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pkg/workflow/dag/WorkflowDagExecutor.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -764,16 +764,18 @@ func (impl *WorkflowDagExecutorImpl) UpdateCiWorkflowForCiSuccess(request *bean2
764764

765765
func (impl *WorkflowDagExecutorImpl) isArtifactScannedByPluginForPipeline(ciArtifact *repository.CiArtifact, pipelineId int,
766766
pipelineStage repository4.PipelineStageType, pluginName string) (bool, bool, error) {
767-
767+
var isScanningDone bool
768768
isScanPluginConfigured, err := impl.pipelineStageService.IsScanPluginConfiguredAtPipelineStage(pipelineId, pipelineStage, pluginName)
769769
if err != nil {
770770
impl.logger.Errorw("error in fetching if a scan plugin is configured or not in a pipeline", "pipelineStage", pipelineStage, "ciArtifact", ciArtifact)
771771
return false, false, err
772772
}
773-
isScanningDone, err := impl.imageScanService.IsImageScanExecutionCompleted(ciArtifact.Image, ciArtifact.ImageDigest)
774-
if err != nil {
775-
impl.logger.Errorw("error in checking if image scanning is completed or not", "image", ciArtifact.Image, "imageDigest", ciArtifact.ImageDigest)
776-
return false, false, err
773+
if isScanPluginConfigured {
774+
isScanningDone, err = impl.imageScanService.IsImageScanExecutionCompleted(ciArtifact.Image, ciArtifact.ImageDigest)
775+
if err != nil {
776+
impl.logger.Errorw("error in checking if image scanning is completed or not", "image", ciArtifact.Image, "imageDigest", ciArtifact.ImageDigest)
777+
return false, false, err
778+
}
777779
}
778780
return isScanPluginConfigured, isScanningDone, nil
779781
}

0 commit comments

Comments
 (0)