@@ -348,7 +348,7 @@ public void doGenerateAllBundles(StaplerRequest2 req, StaplerResponse2 rsp) thro
348
348
* @throws IOException If an input or output exception occurs
349
349
*/
350
350
@ RequirePOST
351
- public HttpRedirect doGenerateAllBundleAsync (StaplerRequest2 req , StaplerResponse2 rsp )
351
+ public HttpRedirect doGenerateBundleAsync (StaplerRequest2 req , StaplerResponse2 rsp )
352
352
throws ServletException , IOException {
353
353
JSONObject json = req .getSubmittedForm ();
354
354
if (!json .has ("components" )) {
@@ -374,7 +374,7 @@ public HttpRedirect doGenerateAllBundleAsync(StaplerRequest2 req, StaplerRespons
374
374
SupportPlugin .setRequesterAuthentication (Jenkins .getAuthentication2 ());
375
375
try {
376
376
try (ACLContext ignored = ACL .as2 (ACL .SYSTEM2 )) {
377
- SupportPlugin .writeBundle (fileOutputStream , components );
377
+ SupportPlugin .writeBundle (fileOutputStream , syncComponent );
378
378
} catch (IOException e ) {
379
379
logger .log (Level .WARNING , e .getMessage (), e );
380
380
}
@@ -552,8 +552,17 @@ protected void compute() throws Exception {
552
552
}
553
553
554
554
try (FileOutputStream fileOutputStream = new FileOutputStream (new File (outputDir , supportBundleName ))) {
555
- SupportPlugin .writeBundle (
556
- fileOutputStream , components , this ::progress , Path .of (outputDir .getAbsolutePath ()));
555
+ SupportPlugin .setRequesterAuthentication (Jenkins .getAuthentication2 ());
556
+ try {
557
+ try (ACLContext ignored = ACL .as2 (ACL .SYSTEM2 )) {
558
+ SupportPlugin .writeBundle (
559
+ fileOutputStream , components , this ::progress , Path .of (outputDir .getAbsolutePath ()));
560
+ } catch (IOException e ) {
561
+ logger .log (Level .FINE , e .getMessage (), e );
562
+ }
563
+ } finally {
564
+ SupportPlugin .clearRequesterAuthentication ();
565
+ }
557
566
} finally {
558
567
logger .fine ("Processing support bundle async completed" );
559
568
}
0 commit comments