113113import static oracle .kubernetes .operator .helpers .PodHelperTestBase .createSecretKeyRefEnvVar ;
114114import static oracle .kubernetes .operator .helpers .PodHelperTestBase .createSecurityContext ;
115115import static oracle .kubernetes .operator .helpers .PodHelperTestBase .createToleration ;
116+ import static oracle .kubernetes .operator .helpers .StepContextConstants .FLUENTBIT_CONFIGMAP_VOLUME ;
116117import static oracle .kubernetes .operator .helpers .StepContextConstants .FLUENTD_CONFIGMAP_NAME_SUFFIX ;
118+ import static oracle .kubernetes .operator .helpers .StepContextConstants .FLUENTD_CONFIGMAP_VOLUME ;
117119import static oracle .kubernetes .operator .helpers .StepContextConstants .FLUENTD_CONFIG_DATA_NAME ;
118120import static oracle .kubernetes .operator .helpers .StepContextConstants .FLUENTD_CONTAINER_NAME ;
119121import static oracle .kubernetes .operator .helpers .StepContextConstants .INIT_DOMAIN_ON_PV_CONTAINER ;
@@ -500,6 +502,46 @@ void whenFluentdWatchIntrospectLogsEnable_jobPodShouldHaveFluentdSidecar() {
500502
501503 }
502504
505+ @ Test
506+ void whenFluentdWatchIntrospectLogsEnable_jobPodShouldHaveFluentdVolume () {
507+ configureDomain ().withFluentdConfiguration (true , "dummy-cred" ,
508+ null , null , null );
509+
510+ V1JobSpec jobSpec = createJobSpec ();
511+
512+ Optional <Object > list = Optional .ofNullable (jobSpec )
513+ .map (V1JobSpec ::getTemplate )
514+ .map (V1PodTemplateSpec ::getSpec )
515+ .map (V1PodSpec ::getVolumes )
516+ .map (c -> c .isEmpty () ? null : c .stream ().filter (v -> v .getName ()
517+ .equals (FLUENTD_CONFIGMAP_VOLUME )).findAny ().orElse (null ));
518+
519+ assertThat (list , notNullValue ());
520+
521+ assertThat (list , not (Optional .empty ()));
522+
523+ }
524+
525+ @ Test
526+ void whenFluentbitWatchIntrospectLogsEnable_jobPodShouldHaveFluentbitVolume () {
527+ configureDomain ().withFluentbitConfiguration (true ,"dummy-cred" , "" ,
528+ "" , null ,null );
529+
530+ V1JobSpec jobSpec = createJobSpec ();
531+
532+ Optional <Object > list = Optional .ofNullable (jobSpec )
533+ .map (V1JobSpec ::getTemplate )
534+ .map (V1PodTemplateSpec ::getSpec )
535+ .map (V1PodSpec ::getVolumes )
536+ .map (c -> c .isEmpty () ? null : c .stream ().filter (v -> v .getName ()
537+ .equals (FLUENTBIT_CONFIGMAP_VOLUME )).findAny ().orElse (null ));
538+
539+ assertThat (list , notNullValue ());
540+
541+ assertThat (list , not (Optional .empty ()));
542+
543+ }
544+
503545 @ Test
504546 void whenFluentdWatchIntrospectLogsDisable_jobPodShouldHaveFluentdSidecar () {
505547 configureDomain ().withFluentdConfiguration (false , "dummy-cred" ,
@@ -516,6 +558,7 @@ void whenFluentdWatchIntrospectLogsDisable_jobPodShouldHaveFluentdSidecar() {
516558
517559 }
518560
561+
519562 @ Test
520563 void whenNoFluentdConfigmap_createIt () {
521564 configureDomain ().withFluentdConfiguration (false , "dummy-cred" ,
0 commit comments