Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,30 +94,30 @@ func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionId(scanExecutionId
Where("image_scan_execution_result.scan_execution_id = ?", id).Select()
*/

err := impl.dbConnection.Model(&models).ColumnExpr("DISTINCT cve_store_name").Column("image_scan_execution_result.*", "CveStore").
err := impl.dbConnection.Model(&models).Column("image_scan_execution_result.*", "CveStore").
Where("image_scan_execution_result.image_scan_execution_history_id = ?", scanExecutionId).
Select()
return models, err
}

func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionIds(ids []int) ([]*ImageScanExecutionResult, error) {
var models []*ImageScanExecutionResult
err := impl.dbConnection.Model(&models).ColumnExpr("DISTINCT cve_store_name").Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
err := impl.dbConnection.Model(&models).Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
Where("image_scan_execution_result.image_scan_execution_history_id in(?)", pg.In(ids)).
Select()
return models, err
}

func (impl ImageScanResultRepositoryImpl) FindByImageDigest(imageDigest string) ([]*ImageScanExecutionResult, error) {
var model []*ImageScanExecutionResult
err := impl.dbConnection.Model(&model).ColumnExpr("DISTINCT cve_store_name").Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
err := impl.dbConnection.Model(&model).Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
Where("image_scan_execution_history.image_hash = ?", imageDigest).Order("image_scan_execution_history.execution_time desc").Select()
return model, err
}

func (impl ImageScanResultRepositoryImpl) FindByImageDigests(digest []string) ([]*ImageScanExecutionResult, error) {
var models []*ImageScanExecutionResult
err := impl.dbConnection.Model(&models).ColumnExpr("DISTINCT cve_store_name").Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
err := impl.dbConnection.Model(&models).Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
Where("image_hash in (?)", pg.In(digest)).Order("execution_time desc").Select()
return models, err
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/module/ModuleService.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,6 @@ func (impl ModuleServiceImpl) HandleModuleAction(userId int32, moduleName string
}, nil
}
func (impl ModuleServiceImpl) EnableModule(moduleName, version string) (*ActionResponse, error) {
if impl.serverEnvConfig.DevtronInstallationType != serverBean.DevtronInstallationTypeOssHelm {
return nil, errors.New("module Enabling is not allowed")
}

// get module by name
module, err := impl.moduleRepository.FindOne(moduleName)
Expand Down