File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline
test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,10 @@ public final class SecretsMasker extends TaskListenerDecorator {
6161
6262 private static final long serialVersionUID = 1 ;
6363
64- private final Set <String > values ;
65-
6664 private final Pattern pattern ;
6765
6866 private SecretsMasker (Set <String > values ) {
6967 assert !values .isEmpty ();
70- this .values = values ;
7168 // stored at creation time so SecretPatternFactory extensions are properly loaded
7269 // when/if this decorator runs at agent side (see DurableTaskStep.USE_WATCHING)
7370 this .pattern = SecretPatterns .getAggregateSecretPattern (values );
Original file line number Diff line number Diff line change @@ -269,11 +269,14 @@ public void runInPodFromYaml() throws Exception {
269269
270270 // SECURITY-3079
271271 DurableTaskStep .USE_WATCHING = true ;
272- WorkflowRun build = p .scheduleBuild2 (0 ).waitForStart ();
273- r .assertBuildStatusSuccess (r .waitForCompletion (build ));
274- r .assertLogNotContains (CONTAINER_ENV_VAR_FROM_SECRET_VALUE , build );
275- r .assertLogContains ("INSIDE_CONTAINER_ENV_VAR_FROM_SECRET = **** or " + CONTAINER_ENV_VAR_FROM_SECRET_VALUE .toUpperCase (Locale .ROOT ) + "\n " , build );
276- DurableTaskStep .USE_WATCHING = false ;
272+ try {
273+ WorkflowRun build = p .scheduleBuild2 (0 ).waitForStart ();
274+ r .assertBuildStatusSuccess (r .waitForCompletion (build ));
275+ r .assertLogNotContains (CONTAINER_ENV_VAR_FROM_SECRET_VALUE , build );
276+ r .assertLogContains ("INSIDE_CONTAINER_ENV_VAR_FROM_SECRET = **** or " + CONTAINER_ENV_VAR_FROM_SECRET_VALUE .toUpperCase (Locale .ROOT ) + "\n " , build );
277+ } finally {
278+ DurableTaskStep .USE_WATCHING = false ;
279+ }
277280 }
278281
279282 @ Test
You can’t perform that action at this time.
0 commit comments