Search in sources :

Example 1 with DefaultResourceService

use of org.eclipse.jkube.kit.resource.service.DefaultResourceService in project jkube by eclipse.

the class ResourceMojo method initJKubeServiceHubBuilder.

@Override
protected JKubeServiceHub.JKubeServiceHubBuilder initJKubeServiceHubBuilder(JavaProject javaProject) {
    realResourceDir = ResourceUtil.getFinalResourceDir(resourceDir, environment);
    final ResourceServiceConfig resourceServiceConfig = ResourceServiceConfig.builder().project(javaProject).resourceDir(realResourceDir).targetDir(targetDir).resourceFileType(resourceFileType).resourceConfig(resources).resourceFilesProcessor(resourceFiles -> mavenFilterFiles(resourceFiles, workDir)).interpolateTemplateParameters(interpolateTemplateParameters).build();
    return super.initJKubeServiceHubBuilder(javaProject).resourceService(new LazyBuilder<>(() -> new DefaultResourceService(resourceServiceConfig)));
}
Also used : DefaultResourceService(org.eclipse.jkube.kit.resource.service.DefaultResourceService) ResourceServiceConfig(org.eclipse.jkube.kit.config.resource.ResourceServiceConfig)

Example 2 with DefaultResourceService

use of org.eclipse.jkube.kit.resource.service.DefaultResourceService in project jkube by eclipse.

the class KubernetesResourceTask method initJKubeServiceHubBuilder.

@Override
protected JKubeServiceHub.JKubeServiceHubBuilder initJKubeServiceHubBuilder() {
    JKubeServiceHub.JKubeServiceHubBuilder builder = super.initJKubeServiceHubBuilder();
    ResourceConfig resourceConfig = kubernetesExtension.resources;
    if (kubernetesExtension.getNamespaceOrNull() != null) {
        resourceConfig = ResourceConfig.toBuilder(resourceConfig).namespace(kubernetesExtension.getNamespaceOrNull()).build();
    }
    final ResourceServiceConfig resourceServiceConfig = ResourceServiceConfig.builder().project(kubernetesExtension.javaProject).resourceDir(resolveResourceSourceDirectory()).targetDir(kubernetesExtension.getResourceTargetDirectoryOrDefault()).resourceFileType(kubernetesExtension.getResourceFileTypeOrDefault()).resourceConfig(resourceConfig).interpolateTemplateParameters(kubernetesExtension.getInterpolateTemplateParametersOrDefault()).resourceFilesProcessor(this::gradleFilterFiles).build();
    builder.resourceService(new LazyBuilder<>(() -> new DefaultResourceService(resourceServiceConfig)));
    return builder;
}
Also used : DefaultResourceService(org.eclipse.jkube.kit.resource.service.DefaultResourceService) ResourceConfig(org.eclipse.jkube.kit.config.resource.ResourceConfig) ResourceServiceConfig(org.eclipse.jkube.kit.config.resource.ResourceServiceConfig) JKubeServiceHub(org.eclipse.jkube.kit.config.service.JKubeServiceHub)

Aggregations

ResourceServiceConfig (org.eclipse.jkube.kit.config.resource.ResourceServiceConfig)2 DefaultResourceService (org.eclipse.jkube.kit.resource.service.DefaultResourceService)2 ResourceConfig (org.eclipse.jkube.kit.config.resource.ResourceConfig)1 JKubeServiceHub (org.eclipse.jkube.kit.config.service.JKubeServiceHub)1