File tree 4 files changed +42
-1
lines changed
4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -37,3 +37,15 @@ GC Policy rule#2:
37
37
GC Policy rule#3:
38
38
All: true
39
39
Keep Bytes: 94.06GiB
40
+ File#buildkitd.toml:
41
+ > debug = true
42
+ > insecure-entitlements = ["network.host", "security.insecure"]
43
+ > trace = true
44
+ >
45
+ > [log]
46
+ > format = "text"
47
+ >
48
+ File#foo.txt:
49
+ > foo = bar
50
+ > baz = qux
51
+ >
Original file line number Diff line number Diff line change @@ -449,7 +449,19 @@ describe('parseInspect', () => {
449
449
"all" : true ,
450
450
"keepBytes" : "94.06GiB" ,
451
451
}
452
- ]
452
+ ] ,
453
+ "files" : {
454
+ "buildkitd.toml" : `debug = true
455
+ insecure-entitlements = ["network.host", "security.insecure"]
456
+ trace = true
457
+
458
+ [log]
459
+ format = "text"
460
+ ` ,
461
+ "foo.txt" : `foo = bar
462
+ baz = qux
463
+ ` ,
464
+ }
453
465
}
454
466
]
455
467
}
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ export class Builder {
89
89
let parsingType : string | undefined ;
90
90
let currentNode : NodeInfo = { } ;
91
91
let currentGCPolicy : GCPolicy | undefined ;
92
+ let currentFile : string | undefined ;
92
93
for ( const line of data . trim ( ) . split ( `\n` ) ) {
93
94
const [ key , ...rest ] = line . split ( ':' ) ;
94
95
const lkey = key . toLowerCase ( ) ;
@@ -178,6 +179,12 @@ export class Builder {
178
179
currentGCPolicy = undefined ;
179
180
}
180
181
break ;
182
+ case lkey . startsWith ( 'file#' ) :
183
+ parsingType = 'file' ;
184
+ currentFile = key . split ( '#' ) [ 1 ] ;
185
+ currentNode . files = currentNode . files || { } ;
186
+ currentNode . files [ currentFile ] = '' ;
187
+ break ;
181
188
default : {
182
189
switch ( parsingType || '' ) {
183
190
case 'features' : {
@@ -215,6 +222,15 @@ export class Builder {
215
222
}
216
223
break ;
217
224
}
225
+ case 'file' : {
226
+ if ( currentFile && currentNode . files ) {
227
+ if ( currentNode . files [ currentFile ] . length > 0 ) {
228
+ currentNode . files [ currentFile ] += '\n' ;
229
+ }
230
+ currentNode . files [ currentFile ] += line . replace ( / ^ \s > \s ? / , '' ) ;
231
+ }
232
+ break ;
233
+ }
218
234
}
219
235
}
220
236
}
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export interface NodeInfo extends Node {
35
35
features ?: Record < string , boolean > ;
36
36
labels ?: Record < string , string > ;
37
37
gcPolicy ?: Array < GCPolicy > ;
38
+ files ?: Record < string , string > ;
38
39
}
39
40
40
41
export interface GCPolicy {
You can’t perform that action at this time.
0 commit comments