File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,10 @@ async function buildResponse(
200200 facts : [ depGraphFact , ...additionalFacts ] ,
201201 target : {
202202 image : depGraph . rootPkg . name ,
203+ ...( options &&
204+ options [ "remote-repo-url" ] && {
205+ remoteUrl : options [ "remote-repo-url" ] ,
206+ } ) ,
203207 } ,
204208 identity : {
205209 type : depGraph . pkgManager . name ,
Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ export interface AutoDetectedUserInstructions {
104104
105105export interface ContainerTarget {
106106 image : string ;
107+ /** Set the remote URL for a container image image. */
108+ remoteUrl ?: string ;
107109}
108110
109111/**
@@ -228,6 +230,8 @@ export interface PluginOptions {
228230 /** The default is "false". */
229231 "collect-application-files" : boolean | string ;
230232 "target-reference" : string ;
233+
234+ "remote-repo-url" : string ;
231235}
232236
233237export interface DepTreeDep {
Original file line number Diff line number Diff line change @@ -60,3 +60,18 @@ it("provides imageName fact with imageNameAndDigest and imageNameAndTag scan opt
6060 ] ) ,
6161 ) ;
6262} ) ;
63+
64+ it ( "remoteUrl is set in ContainerTarget when remote-repo-url scan option is provided" , async ( ) => {
65+ const fixturePath = getFixture ( [ "/docker-archives" , "alpine-arm64.tar" ] ) ;
66+ const imagePath = `docker-archive:${ fixturePath } ` ;
67+
68+ const pluginResponse = await plugin . scan ( {
69+ path : imagePath ,
70+ "remote-repo-url" : "https://github.com/org/my-repo-test" ,
71+ } ) ;
72+ pluginResponse . scanResults . forEach ( ( scanResult ) => {
73+ expect ( scanResult . target . remoteUrl ) . toEqual (
74+ "https://github.com/org/my-repo-test" ,
75+ ) ;
76+ } ) ;
77+ } ) ;
You can’t perform that action at this time.
0 commit comments