1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

fix(detectExecuteScan): do not read imageNameTags from CPE directly (#4833)

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
This commit is contained in:
Pavel Busko 2024-02-19 14:01:41 +01:00 committed by GitHub
parent 49b8080461
commit bdc49e7be6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,7 +20,6 @@ import (
"github.com/SAP/jenkins-library/pkg/log" "github.com/SAP/jenkins-library/pkg/log"
"github.com/SAP/jenkins-library/pkg/maven" "github.com/SAP/jenkins-library/pkg/maven"
"github.com/SAP/jenkins-library/pkg/orchestrator" "github.com/SAP/jenkins-library/pkg/orchestrator"
"github.com/SAP/jenkins-library/pkg/piperenv"
"github.com/SAP/jenkins-library/pkg/piperutils" "github.com/SAP/jenkins-library/pkg/piperutils"
"github.com/SAP/jenkins-library/pkg/reporting" "github.com/SAP/jenkins-library/pkg/reporting"
"github.com/SAP/jenkins-library/pkg/telemetry" "github.com/SAP/jenkins-library/pkg/telemetry"
@ -267,13 +266,6 @@ func mapDetectError(err error, config detectExecuteScanOptions, utils detectUtil
} }
func runDetectImages(ctx context.Context, config detectExecuteScanOptions, utils detectUtils, sys *blackduckSystem, influx *detectExecuteScanInflux, blackduckSystem *blackduckSystem) error { func runDetectImages(ctx context.Context, config detectExecuteScanOptions, utils detectUtils, sys *blackduckSystem, influx *detectExecuteScanInflux, blackduckSystem *blackduckSystem) error {
cpePath := filepath.Join(GeneralConfig.EnvRootPath, "commonPipelineEnvironment")
imagesRaw := piperenv.GetResourceParameter(cpePath, "container", "imageNameTags.json")
if imagesRaw == "" {
log.Entry().Debugf("No images found to be scanned")
return nil
}
var err error var err error
log.Entry().Infof("Scanning %d images", len(config.ImageNameTags)) log.Entry().Infof("Scanning %d images", len(config.ImageNameTags))
for _, image := range config.ImageNameTags { for _, image := range config.ImageNameTags {