@@ -426,19 +426,21 @@ func (impl *TriggerServiceImpl) ManualCdTrigger(triggerContext bean.TriggerConte
426
426
impl .logger .Warnw ("unable to migrate deprecated DataSource" , "artifactId" , artifact .Id )
427
427
}
428
428
}
429
- vulnerabilityCheckRequest := adapter .GetVulnerabilityCheckRequest (cdPipeline , artifact .ImageDigest )
430
- isVulnerable , err := impl .imageScanService .GetArtifactVulnerabilityStatus (ctx , vulnerabilityCheckRequest )
431
- if err != nil {
432
- impl .logger .Errorw ("error in getting Artifact vulnerability status, ManualCdTrigger" , "err" , err )
433
- return 0 , err
434
- }
429
+ if isNotHibernateRequest (overrideRequest .DeploymentType ) {
430
+ vulnerabilityCheckRequest := adapter .GetVulnerabilityCheckRequest (cdPipeline , artifact .ImageDigest )
431
+ isVulnerable , err := impl .imageScanService .GetArtifactVulnerabilityStatus (ctx , vulnerabilityCheckRequest )
432
+ if err != nil {
433
+ impl .logger .Errorw ("error in getting Artifact vulnerability status, ManualCdTrigger" , "err" , err )
434
+ return 0 , err
435
+ }
435
436
436
- if isVulnerable == true {
437
- // if image vulnerable, update timeline status and return
438
- if err = impl .cdWorkflowCommonService .MarkCurrentDeploymentFailed (runner , errors .New (pipelineConfig .FOUND_VULNERABILITY ), overrideRequest .UserId ); err != nil {
439
- impl .logger .Errorw ("error while updating current runner status to failed, TriggerDeployment" , "wfrId" , runner .Id , "err" , err )
437
+ if isVulnerable == true {
438
+ // if image vulnerable, update timeline status and return
439
+ if err = impl .cdWorkflowCommonService .MarkCurrentDeploymentFailed (runner , errors .New (pipelineConfig .FOUND_VULNERABILITY ), overrideRequest .UserId ); err != nil {
440
+ impl .logger .Errorw ("error while updating current runner status to failed, TriggerDeployment" , "wfrId" , runner .Id , "err" , err )
441
+ }
442
+ return 0 , fmt .Errorf ("found vulnerability for image digest %s" , artifact .ImageDigest )
440
443
}
441
- return 0 , fmt .Errorf ("found vulnerability for image digest %s" , artifact .ImageDigest )
442
444
}
443
445
444
446
// Deploy the release
@@ -537,6 +539,13 @@ func (impl *TriggerServiceImpl) ManualCdTrigger(triggerContext bean.TriggerConte
537
539
return releaseId , err
538
540
}
539
541
542
+ func isNotHibernateRequest (deploymentType models.DeploymentType ) bool {
543
+ if deploymentType == models .DEPLOYMENTTYPE_STOP || deploymentType == models .DEPLOYMENTTYPE_START {
544
+ return false
545
+ }
546
+ return true
547
+ }
548
+
540
549
// TODO: write a wrapper to handle auto and manual trigger
541
550
func (impl * TriggerServiceImpl ) TriggerAutomaticDeployment (request bean.TriggerRequest ) error {
542
551
//in case of manual trigger auth is already applied and for auto triggers there is no need for auth check here
0 commit comments