Skip to content

Commit 7b08d47

Browse files
akram8008dimaste
andauthored
Detect script version 9 (#5154)
* detect script v9 as default and detect script v8 as optional for blackduck * unit test fix --------- Co-authored-by: Dmitrii Pavlukhin <[email protected]>
1 parent 3ad2628 commit 7b08d47

4 files changed

+12
-11
lines changed

cmd/detectExecuteScan.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,11 @@ func getDetectScript(config detectExecuteScanOptions, utils detectUtils) error {
427427
log.Entry().Infof("Downloading Detect Script")
428428

429429
downloadScript := func() error {
430-
if config.UseDetect9 {
431-
return utils.DownloadFile("https://detect.synopsys.com/detect9.sh", "detect.sh", nil, nil)
430+
if config.UseDetect8 {
431+
return utils.DownloadFile("https://detect.synopsys.com/detect8.sh", "detect.sh", nil, nil)
432432
}
433-
return utils.DownloadFile("https://detect.synopsys.com/detect8.sh", "detect.sh", nil, nil)
433+
return utils.DownloadFile("https://detect.synopsys.com/detect9.sh", "detect.sh", nil, nil)
434+
434435
}
435436

436437
if err := downloadScript(); err != nil {

cmd/detectExecuteScan_generated.go

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/detectExecuteScan_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func TestRunDetect(t *testing.T) {
310310
utilsMock.AddFile("detect.sh", []byte(""))
311311
err := runDetect(ctx, detectExecuteScanOptions{}, utilsMock, &detectExecuteScanInflux{})
312312

313-
assert.Equal(t, utilsMock.downloadedFiles["https://detect.synopsys.com/detect8.sh"], "detect.sh")
313+
assert.Equal(t, utilsMock.downloadedFiles["https://detect.synopsys.com/detect9.sh"], "detect.sh")
314314
assert.True(t, utilsMock.HasRemovedFile("detect.sh"))
315315
assert.NoError(t, err)
316316
assert.Equal(t, ".", utilsMock.Dir, "Wrong execution directory used")

resources/metadata/detectExecuteScan.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -653,11 +653,11 @@ spec:
653653
resourceRef:
654654
- name: commonPipelineEnvironment
655655
param: container/repositoryPassword
656-
- name: useDetect9
656+
- name: useDetect8
657657
description:
658-
"This flag enables the use of the supported version 9 of the Detect Script instead of v8"
658+
"This flag enables the use of the supported version 8 of the Detect Script instead of v9"
659659
aliases:
660-
- name: detect/useDetect9
660+
- name: detect/useDetect8
661661
type: bool
662662
scope:
663663
- PARAMETERS

0 commit comments

Comments
 (0)