mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	inspect: provide access to multiple spdx documents
Signed-off-by: Justin Chadwell <me@jedevc.com>
(cherry picked from commit 3ce17b01dc)
			
			
This commit is contained in:
		
				
					committed by
					
						
						Tonis Tiigi
					
				
			
			
				
	
			
			
			
						parent
						
							793082f543
						
					
				
				
					commit
					9d4f38c5fa
				
			@@ -256,6 +256,7 @@ func (l *loader) scanConfig(ctx context.Context, fetcher remotes.Fetcher, desc o
 | 
			
		||||
 | 
			
		||||
type sbomStub struct {
 | 
			
		||||
	SPDX  interface{}   `json:",omitempty"`
 | 
			
		||||
	SPDXs []interface{} `json:",omitempty"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (l *loader) scanSBOM(ctx context.Context, fetcher remotes.Fetcher, r *result, refs []digest.Digest, as *asset) error {
 | 
			
		||||
@@ -281,10 +282,12 @@ func (l *loader) scanSBOM(ctx context.Context, fetcher remotes.Fetcher, r *resul
 | 
			
		||||
				if err := json.Unmarshal(dt, &spdx); err != nil {
 | 
			
		||||
					return err
 | 
			
		||||
				}
 | 
			
		||||
				as.sbom = &sbomStub{
 | 
			
		||||
					SPDX: spdx.Predicate,
 | 
			
		||||
 | 
			
		||||
				if as.sbom == nil {
 | 
			
		||||
					as.sbom = &sbomStub{}
 | 
			
		||||
					as.sbom.SPDX = spdx.Predicate
 | 
			
		||||
				}
 | 
			
		||||
				break
 | 
			
		||||
				as.sbom.SPDXs = append(as.sbom.SPDXs, spdx.Predicate)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user