diff --git a/pkg/assessor/manifest/manifest.go b/pkg/assessor/manifest/manifest.go index 834d316..8dc38ae 100644 --- a/pkg/assessor/manifest/manifest.go +++ b/pkg/assessor/manifest/manifest.go @@ -364,7 +364,7 @@ func reducableAptGetInstall(cmdSlices map[int][]string) bool { func reducableApkAdd(cmdSlices map[int][]string) bool { for _, cmdSlice := range cmdSlices { if containsAll(cmdSlice, []string{"apk", "add"}) { - if !containsAll(cmdSlice, []string{"--no-cache"}) { + if !containsAll(cmdSlice, []string{"--no-cache"}) && !containsAll(cmdSlice, []string{"--no-network"}) { return true } } diff --git a/pkg/assessor/manifest/manifest_test.go b/pkg/assessor/manifest/manifest_test.go index a5c0694..344bc0d 100644 --- a/pkg/assessor/manifest/manifest_test.go +++ b/pkg/assessor/manifest/manifest_test.go @@ -225,6 +225,14 @@ func TestReducableApkAdd(t *testing.T) { }, expected: false, }, + "UnReducableNoNetwork": { + cmdSlices: map[int][]string{ + 0: { + "apk", "add", "--no-network", "git", + }, + }, + expected: false, + }, } for testname, v := range tests { actual := reducableApkAdd(v.cmdSlices)