@@ -549,12 +549,6 @@ func (impl *WorkflowDagExecutorImpl) HandlePreStageSuccessEvent(triggerContext t
549549 }
550550 util4 .MergeMaps (pluginArtifacts , cdStageCompleteEvent .PluginRegistryArtifactDetails )
551551
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-
558552 pipeline , err := impl .pipelineRepository .FindById (cdStageCompleteEvent .CdPipelineId )
559553 if err != nil {
560554 return err
@@ -657,13 +651,6 @@ func (impl *WorkflowDagExecutorImpl) HandlePostStageSuccessEvent(triggerContext
657651 return err
658652 }
659653 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- }
667654 PostCDArtifacts , err := impl .commonArtifactService .SavePluginArtifacts (ciArtifact , pluginRegistryImageDetails , cdPipelineId , repository .POST_CD , triggeredBy )
668655 if err != nil {
669656 impl .logger .Errorw ("error in saving plugin artifacts" , "err" , err )
@@ -719,11 +706,6 @@ func (impl *WorkflowDagExecutorImpl) UpdateCiWorkflowForCiSuccess(request *bean2
719706 return err
720707 }
721708
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- }
727709 return nil
728710}
729711
@@ -894,37 +876,6 @@ func (impl *WorkflowDagExecutorImpl) HandleCiSuccessEvent(triggerContext trigger
894876 return buildArtifact .Id , err
895877}
896878
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-
928879func (impl * WorkflowDagExecutorImpl ) WriteCiSuccessEvent (request * bean2.CiArtifactWebhookRequest , pipeline * pipelineConfig.CiPipeline , artifact * repository.CiArtifact ) {
929880 event , _ := impl .eventFactory .Build (util2 .Success , & pipeline .Id , pipeline .AppId , nil , util2 .CI )
930881 event .CiArtifactId = artifact .Id
0 commit comments