Skip to content

Commit 741c56e

Browse files
authored
Pass entire auth config struct to docker pull call (#9)
1 parent c5f8d27 commit 741c56e

4 files changed

Lines changed: 24 additions & 15 deletions

File tree

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ go 1.18
55
require (
66
github.com/Microsoft/hcsshim v0.9.2 // indirect
77
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
8-
github.com/anchore/stereoscope v0.0.0-20220322123031-7a744f443e99
9-
github.com/anchore/syft v0.42.2
8+
github.com/anchore/stereoscope v0.0.0-20220330165332-7fc73ee7b0f0
9+
github.com/anchore/syft v0.43.0
1010
github.com/containerd/containerd v1.5.10 // indirect
1111
github.com/containerd/continuity v0.2.2 // indirect
1212
github.com/docker/cli v20.10.12+incompatible
@@ -104,7 +104,7 @@ require (
104104
github.com/prometheus/procfs v0.7.3 // indirect
105105
github.com/rivo/uniseg v0.2.0 // indirect
106106
github.com/rogpeppe/go-internal v1.8.0 // indirect
107-
github.com/scylladb/go-set v1.0.2 // indirect
107+
github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e // indirect
108108
github.com/spdx/tools-golang v0.2.0 // indirect
109109
github.com/spf13/afero v1.8.0 // indirect
110110
github.com/spf13/cast v1.4.1 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ github.com/anchore/go-version v1.2.2-0.20200701162849-18adb9c92b9b h1:e1bmaoJfZV
145145
github.com/anchore/go-version v1.2.2-0.20200701162849-18adb9c92b9b/go.mod h1:Bkc+JYWjMCF8OyZ340IMSIi2Ebf3uwByOk6ho4wne1E=
146146
github.com/anchore/packageurl-go v0.1.1-0.20220314153042-1bcd40e5206b h1:YJWYt/6KQXR9JR46lLHrTTYi8rcye42tKcyjREA/hvA=
147147
github.com/anchore/packageurl-go v0.1.1-0.20220314153042-1bcd40e5206b/go.mod h1:Blo6OgJNiYF41ufcgHKkbCKF2MDOMlrqhXv/ij6ocR4=
148-
github.com/anchore/stereoscope v0.0.0-20220322123031-7a744f443e99 h1:npngzwfM+fmA56VslKxrcKNhGa2W8MMnASQ1CpuZ1ZA=
149-
github.com/anchore/stereoscope v0.0.0-20220322123031-7a744f443e99/go.mod h1:By2EeOMx9BCf44Wu92W/gsarFKB2Yj921IANAw2Pj1k=
150-
github.com/anchore/syft v0.42.2 h1:mP19PsNYhCUXvYTDNtpuV5SRIRwpgtbKSUrbX+CWKn0=
151-
github.com/anchore/syft v0.42.2/go.mod h1:OA3VoQ416NEo2trKi44g/eb0at8BN15746GKIIUFNlI=
148+
github.com/anchore/stereoscope v0.0.0-20220330165332-7fc73ee7b0f0 h1:mObz7bepZ6DtbIrsB2mxuOE9XEYmVtA/P/EDlKwfbjs=
149+
github.com/anchore/stereoscope v0.0.0-20220330165332-7fc73ee7b0f0/go.mod h1:yoCLUZY0k/pYLNIy0L80p2Ko0PKVNXm8rHtgxp4OiSc=
150+
github.com/anchore/syft v0.43.0 h1:9w52VCgSutRL08ojztoXwG6/KdOjS3w+5ePZqJNGx5o=
151+
github.com/anchore/syft v0.43.0/go.mod h1:Po6PO927XnrHzrs8qshOjAfb/wBmu4cXEeO7FmlWFgk=
152152
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
153153
github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
154154
github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
@@ -1148,8 +1148,8 @@ github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43
11481148
github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI=
11491149
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
11501150
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
1151-
github.com/scylladb/go-set v1.0.2 h1:SkvlMCKhP0wyyct6j+0IHJkBkSZL+TDzZ4E7f7BCcRE=
1152-
github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs=
1151+
github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e h1:7q6NSFZDeGfvvtIRwBrU/aegEYJYmvev0cHAwo17zZQ=
1152+
github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs=
11531153
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
11541154
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
11551155
github.com/securego/gosec/v2 v2.9.1/go.mod h1:oDcDLcatOJxkCGaCaq8lua1jTnYf6Sou4wdiJ1n4iHc=

test/cli/sbom_cmd_test.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
)
1010

1111
func TestSBOMCmdFlags(t *testing.T) {
12+
hiddenPackagesImage := getFixtureImage(t, "image-hidden-packages")
1213
coverageImage := getFixtureImage(t, "image-pkg-coverage")
1314
tmp := t.TempDir() + "/"
1415

@@ -35,7 +36,7 @@ func TestSBOMCmdFlags(t *testing.T) {
3536
assertInOutput("docker-sbom ("),
3637
assertInOutput("Provider:"),
3738
assertInOutput("GitDescription:"),
38-
assertInOutput("syft (v0.42.2)"),
39+
assertInOutput("syft (v0.43.0)"),
3940
assertNotInOutput("not provided"),
4041
assertSuccessfulReturnCode,
4142
},
@@ -55,7 +56,7 @@ func TestSBOMCmdFlags(t *testing.T) {
5556
args: []string{"sbom", "--format", "json", coverageImage},
5657
assertions: []traitAssertion{
5758
assertJsonReport,
58-
assertJsonDescriptor(internal.SyftName, "v0.42.2"),
59+
assertJsonDescriptor(internal.SyftName, "v0.43.0"),
5960
assertNotInOutput("not provided"),
6061
assertSuccessfulReturnCode,
6162
},
@@ -78,17 +79,21 @@ func TestSBOMCmdFlags(t *testing.T) {
7879
},
7980
{
8081
name: "squashed-scope-flag",
81-
args: []string{"sbom", "--format", "json", "--layers", "squashed", coverageImage},
82+
args: []string{"sbom", "--format", "json", "--layers", "squashed", hiddenPackagesImage},
8283
assertions: []traitAssertion{
83-
assertPackageCount(20),
84+
assertPackageCount(162),
85+
assertInOutput("squashed"),
86+
assertNotInOutput("vsftpd"), // hidden package
8487
assertSuccessfulReturnCode,
8588
},
8689
},
8790
{
8891
name: "all-layers-scope-flag",
89-
args: []string{"sbom", "--format", "json", "--layers", "all-layers", coverageImage},
92+
args: []string{"sbom", "--format", "json", "--layers", "all-layers", hiddenPackagesImage},
9093
assertions: []traitAssertion{
91-
assertPackageCount(22),
94+
assertPackageCount(163),
95+
assertInOutput("all-layers"),
96+
assertInOutput("vsftpd"), // hidden package
9297
assertSuccessfulReturnCode,
9398
},
9499
},
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM centos:7.9.2009
2+
# all-layers scope should pickup on vsftpd
3+
RUN yum install -y vsftpd
4+
RUN yum remove -y vsftpd

0 commit comments

Comments
 (0)