@@ -39,14 +39,18 @@ export class Exec {
39
39
this . trimArgs = opts . trimArgs ?? true ;
40
40
}
41
41
42
- async x ( command : string , args ?: string [ ] , opts ?: { neverThrow ?: boolean } ) {
42
+ async x (
43
+ command : string ,
44
+ args ?: string [ ] ,
45
+ opts ?: { neverThrow ?: boolean ; ignoreAbort ?: boolean }
46
+ ) {
43
47
const argsTrimmed = this . trimArgs ? args ?. map ( ( arg ) => arg . trim ( ) ) : args ;
44
48
45
49
const commandWithFirstArg = `${ command } ${ argsTrimmed ?. length ? ` ${ argsTrimmed [ 0 ] } ` : "" } ` ;
46
50
this . logger . debug ( `exec: ${ commandWithFirstArg } ` , { command, args, argsTrimmed } ) ;
47
51
48
52
const result = x ( command , argsTrimmed , {
49
- signal : this . abortSignal ,
53
+ signal : opts ?. ignoreAbort ? undefined : this . abortSignal ,
50
54
// We don't use this as it doesn't cover killed and aborted processes
51
55
// throwOnError: true,
52
56
} ) ;
@@ -157,7 +161,7 @@ export class Buildah {
157
161
async cleanup ( ) {
158
162
if ( this . containers . size > 0 ) {
159
163
try {
160
- const output = await this . x ( "buildah" , [ "rm" , ...this . containers ] ) ;
164
+ const output = await this . x ( "buildah" , [ "rm" , ...this . containers ] , { ignoreAbort : true } ) ;
161
165
this . containers . clear ( ) ;
162
166
163
167
if ( output . stderr . length > 0 ) {
@@ -172,7 +176,7 @@ export class Buildah {
172
176
173
177
if ( this . images . size > 0 ) {
174
178
try {
175
- const output = await this . x ( "buildah" , [ "rmi" , ...this . images ] ) ;
179
+ const output = await this . x ( "buildah" , [ "rmi" , ...this . images ] , { ignoreAbort : true } ) ;
176
180
this . images . clear ( ) ;
177
181
178
182
if ( output . stderr . length > 0 ) {
@@ -251,7 +255,7 @@ export class Crictl {
251
255
async cleanup ( ) {
252
256
if ( this . archives . size > 0 ) {
253
257
try {
254
- const output = await this . x ( "rm" , [ "-v" , ...this . archives ] ) ;
258
+ const output = await this . x ( "rm" , [ "-v" , ...this . archives ] , { ignoreAbort : true } ) ;
255
259
this . archives . clear ( ) ;
256
260
257
261
if ( output . stderr . length > 0 ) {
0 commit comments