@@ -549,12 +549,6 @@ func (impl *WorkflowDagExecutorImpl) HandlePreStageSuccessEvent(triggerContext t
549
549
}
550
550
util4 .MergeMaps (pluginArtifacts , cdStageCompleteEvent .PluginRegistryArtifactDetails )
551
551
552
- err = impl .deactivateUnusedPaths (wfRunner .ImagePathReservationIds , pluginArtifacts )
553
- if err != nil {
554
- impl .logger .Errorw ("error in deactiving unusedImagePaths" , "err" , err )
555
- return err
556
- }
557
-
558
552
pipeline , err := impl .pipelineRepository .FindById (cdStageCompleteEvent .CdPipelineId )
559
553
if err != nil {
560
554
return err
@@ -657,13 +651,6 @@ func (impl *WorkflowDagExecutorImpl) HandlePostStageSuccessEvent(triggerContext
657
651
return err
658
652
}
659
653
if len (pluginRegistryImageDetails ) > 0 {
660
- if wfr != nil {
661
- err = impl .deactivateUnusedPaths (wfr .ImagePathReservationIds , pluginRegistryImageDetails )
662
- if err != nil {
663
- impl .logger .Errorw ("error in deactivation images" , "err" , err )
664
- return err
665
- }
666
- }
667
654
PostCDArtifacts , err := impl .commonArtifactService .SavePluginArtifacts (ciArtifact , pluginRegistryImageDetails , cdPipelineId , repository .POST_CD , triggeredBy )
668
655
if err != nil {
669
656
impl .logger .Errorw ("error in saving plugin artifacts" , "err" , err )
@@ -719,11 +706,6 @@ func (impl *WorkflowDagExecutorImpl) UpdateCiWorkflowForCiSuccess(request *bean2
719
706
return err
720
707
}
721
708
722
- err = impl .deactivateUnusedPaths (savedWorkflow .ImagePathReservationIds , request .PluginRegistryArtifactDetails )
723
- if err != nil {
724
- impl .logger .Errorw ("error in deactivation images" , "err" , err )
725
- return err
726
- }
727
709
return nil
728
710
}
729
711
@@ -894,37 +876,6 @@ func (impl *WorkflowDagExecutorImpl) HandleCiSuccessEvent(triggerContext trigger
894
876
return buildArtifact .Id , err
895
877
}
896
878
897
- func (impl * WorkflowDagExecutorImpl ) deactivateUnusedPaths (reserveImagePathIds []int , pluginRegistryArtifactDetails map [string ][]string ) error {
898
- // for copy container image plugin if images reserved are not equal to actual copird
899
- reservedImagePaths , err := impl .customTagService .GetImagePathsByIds (reserveImagePathIds )
900
- if err != nil && err != pg .ErrNoRows {
901
- impl .logger .Errorw ("error in getting imagePaths by ids" , "ImagePathReservationIds" , reserveImagePathIds , "err" , err )
902
- return err
903
- }
904
-
905
- copiedImagesMapping := make (map [string ]bool )
906
- for _ , savedImages := range pluginRegistryArtifactDetails {
907
- for _ , image := range savedImages {
908
- copiedImagesMapping [image ] = true
909
- }
910
- }
911
-
912
- unusedPaths := make ([]string , 0 , len (reservedImagePaths ))
913
- for _ , reservedImage := range reservedImagePaths {
914
- if _ , ok := copiedImagesMapping [reservedImage .ImagePath ]; ! ok {
915
- unusedPaths = append (unusedPaths , reservedImage .ImagePath )
916
- }
917
- }
918
-
919
- err = impl .customTagService .DeactivateImagePathReservationByImagePath (unusedPaths )
920
- if err != nil {
921
- impl .logger .Errorw ("error in deactivating unused image paths" , "imagePathReservationIds" , reserveImagePathIds , "err" , err )
922
- return err
923
- }
924
-
925
- return nil
926
- }
927
-
928
879
func (impl * WorkflowDagExecutorImpl ) WriteCiSuccessEvent (request * bean2.CiArtifactWebhookRequest , pipeline * pipelineConfig.CiPipeline , artifact * repository.CiArtifact ) {
929
880
event , _ := impl .eventFactory .Build (util2 .Success , & pipeline .Id , pipeline .AppId , nil , util2 .CI )
930
881
event .CiArtifactId = artifact .Id
0 commit comments