7474import org .hamcrest .MatcherAssert ;
7575import org .hamcrest .Matchers ;
7676import org .jenkinsci .plugins .workflow .job .WorkflowRun ;
77+ import org .jenkinsci .plugins .workflow .steps .durable_task .DurableTaskStep ;
7778import org .jenkinsci .plugins .workflow .test .steps .SemaphoreStep ;
7879import org .junit .After ;
7980import org .junit .Before ;
@@ -247,7 +248,7 @@ public void runIn2Pods() throws Exception {
247248 deletePods (cloud .connect (), getLabels (cloud , this , name ), true ));
248249 }
249250
250- @ Issue ("JENKINS-57893" )
251+ @ Issue ({ "JENKINS-57893" , "SECURITY-3079" } )
251252 @ Test
252253 public void runInPodFromYaml () throws Exception {
253254 List <PodTemplate > templates = cloud .getTemplates ();
@@ -265,6 +266,14 @@ public void runInPodFromYaml() throws Exception {
265266 r .assertLogContains ("INSIDE_CONTAINER_ENV_VAR_FROM_SECRET = **** or " + CONTAINER_ENV_VAR_FROM_SECRET_VALUE .toUpperCase (Locale .ROOT ) + "\n " , b );
266267 assertFalse ("There are pods leftover after test execution, see previous logs" ,
267268 deletePods (cloud .connect (), getLabels (cloud , this , name ), true ));
269+
270+ // SECURITY-3079
271+ 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 ;
268277 }
269278
270279 @ Test
0 commit comments