@@ -49,7 +49,7 @@ func Upload(sb *types.Sbom, workspace string, apikey string) error {
49
49
}
50
50
51
51
newTransaction := context .NewTransaction
52
- _ , err := transactSbom (sb , newTransaction )
52
+ err := transactSbom (sb , newTransaction )
53
53
if err != nil {
54
54
return errors .Wrap (err , "failed to transact image" )
55
55
}
@@ -70,19 +70,19 @@ func Send(sb *types.Sbom, entities chan<- string) error {
70
70
entities <- entitiesString
71
71
})
72
72
}
73
- _ , err := transactSbom (sb , newTransaction )
73
+ err := transactSbom (sb , newTransaction )
74
74
if err != nil {
75
75
return errors .Wrap (err , "failed to transact image" )
76
76
}
77
77
78
78
return nil
79
79
}
80
80
81
- func transactSbom (sb * types.Sbom , newTransaction func () skill.Transaction ) ( * ImageEntity , error ) {
81
+ func transactSbom (sb * types.Sbom , newTransaction func () skill.Transaction ) error {
82
82
now := time .Now ()
83
83
host , name , err := parseReference (sb )
84
84
if err != nil {
85
- return nil , errors .Wrap (err , "failed to obtain host and repository" )
85
+ return errors .Wrap (err , "failed to obtain host and repository" )
86
86
}
87
87
config := (* sb ).Source .Image .Config
88
88
manifest := (* sb ).Source .Image .Manifest
@@ -176,7 +176,7 @@ func transactSbom(sb *types.Sbom, newTransaction func() skill.Transaction) (*Ima
176
176
// transact the image with all its metadata (repo, tags, layers, blobs, ports, env etc)
177
177
err = transaction .AddEntities (image , platform ).Transact ()
178
178
if err != nil {
179
- return nil , errors .Wrapf (err , "failed to transact image" )
179
+ return errors .Wrapf (err , "failed to transact image" )
180
180
}
181
181
182
182
// transact all packages in chunks
@@ -226,22 +226,22 @@ func transactSbom(sb *types.Sbom, newTransaction func() skill.Transaction) (*Ima
226
226
image .Dependencies = & skill.ManyRef {Add : transaction .EntityRefs ("package/dependency" )}
227
227
err := transaction .AddEntities (image ).Transact ()
228
228
if err != nil {
229
- return nil , errors .Wrapf (err , "failed to transact packages" )
229
+ return errors .Wrapf (err , "failed to transact packages" )
230
230
}
231
231
}
232
232
233
233
image = skill .MakeEntity (ImageEntity {
234
234
Digest : sb .Source .Image .Digest ,
235
235
SbomState : Indexed ,
236
- }, "$repo " )
236
+ }, "$image " )
237
237
if sb .Artifacts != nil {
238
238
image .SbomState = Indexed
239
239
}
240
240
err = newTransaction ().Ordered ().AddEntities (image ).Transact ()
241
241
if err != nil {
242
- return nil , errors .Wrapf (err , "failed to transact packages" )
242
+ return errors .Wrapf (err , "failed to transact packages" )
243
243
}
244
- return & image , nil
244
+ return nil
245
245
}
246
246
247
247
func digestChainIds (manifest * v1.Manifest ) []digest.Digest {
0 commit comments