@Override
    public List<HasMetadata> buildAccompanyingKubernetesResources() throws IOException {
        return getTaskManagerPodTemplateFile()
                .map(
                        FunctionUtils.uncheckedFunction(
                                file -> {
                                    final Map<String, String> data = new HashMap<>();
                                    data.put(
                                            TASK_MANAGER_POD_TEMPLATE_FILE_NAME,
                                            Files.toString(file, StandardCharsets.UTF_8));
                                    final HasMetadata flinkConfConfigMap =
                                            new ConfigMapBuilder()
                                                    .withApiVersion(Constants.API_VERSION)
                                                    .withNewMetadata()
                                                    .withName(podTemplateConfigMapName)
                                                    .withLabels(
                                                            kubernetesComponentConf
                                                                    .getCommonLabels())
                                                    .endMetadata()
                                                    .addToData(data)
                                                    .build();
                                    return Collections.singletonList(flinkConfConfigMap);
                                }))
                .orElse(Collections.emptyList());
    }
@Test
    void testBuildAccompanyingKubernetesResourcesAddsPodTemplateAsConfigMap() throws IOException {
        KubernetesTestUtils.createTemporyFile(
                POD_TEMPLATE_DATA, flinkConfDir, POD_TEMPLATE_FILE_NAME);

        final List<HasMetadata> additionalResources =
                podTemplateMountDecorator.buildAccompanyingKubernetesResources();
        assertThat(additionalResources).hasSize(1);

        final ConfigMap resultConfigMap = (ConfigMap) additionalResources.get(0);

        final Map<String, String> resultData = resultConfigMap.getData();
        assertThat(resultData.get(TASK_MANAGER_POD_TEMPLATE_FILE_NAME))
                .isEqualTo(POD_TEMPLATE_DATA);
    }