From 8f5fdb39545523de2977bd0b6ce6070031e3b986 Mon Sep 17 00:00:00 2001 From: Ludovic DEHON Date: Thu, 17 Aug 2023 19:56:39 +0200 Subject: [PATCH] refactor(tasks): relocate BashService to PluginService --- gradle.properties | 4 ++-- .../java/io/kestra/plugin/kubernetes/AbstractPod.java | 9 ++++----- .../plugin/kubernetes/services/LoggingOutputStream.java | 5 ++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/gradle.properties b/gradle.properties index 12d5dcf..a8727c7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=0.10.1-SNAPSHOT -kestraVersion=0.10.+ +version=0.11.0-SNAPSHOT +kestraVersion=0.11.+ micronautVersion=3.9.3 lombokVersion=1.18.28 diff --git a/src/main/java/io/kestra/plugin/kubernetes/AbstractPod.java b/src/main/java/io/kestra/plugin/kubernetes/AbstractPod.java index 0f4d701..49b5b62 100644 --- a/src/main/java/io/kestra/plugin/kubernetes/AbstractPod.java +++ b/src/main/java/io/kestra/plugin/kubernetes/AbstractPod.java @@ -5,7 +5,7 @@ import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.models.annotations.PluginProperty; import io.kestra.core.runners.RunContext; -import io.kestra.core.tasks.scripts.BashService; +import io.kestra.core.tasks.PluginUtilsService; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import lombok.experimental.SuperBuilder; @@ -15,7 +15,6 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.*; @@ -131,7 +130,7 @@ protected void handleFiles(RunContext runContext, ObjectMeta metadata, PodSpec s .build(); if (this.outputFiles != null) { - generatedOutputFiles = BashService.createOutputFiles( + generatedOutputFiles = PluginUtilsService.createOutputFiles( tempDir(runContext), this.outputFiles, additionalVars @@ -143,9 +142,9 @@ protected void handleFiles(RunContext runContext, ObjectMeta metadata, PodSpec s } if (this.inputFiles != null) { - Map finalInputFiles = BashService.transformInputFiles(runContext, this.inputFiles); + Map finalInputFiles = PluginUtilsService.transformInputFiles(runContext, this.inputFiles); - BashService.createInputFiles( + PluginUtilsService.createInputFiles( runContext, tempDir(runContext), finalInputFiles, diff --git a/src/main/java/io/kestra/plugin/kubernetes/services/LoggingOutputStream.java b/src/main/java/io/kestra/plugin/kubernetes/services/LoggingOutputStream.java index 0764607..f841709 100644 --- a/src/main/java/io/kestra/plugin/kubernetes/services/LoggingOutputStream.java +++ b/src/main/java/io/kestra/plugin/kubernetes/services/LoggingOutputStream.java @@ -1,7 +1,7 @@ package io.kestra.plugin.kubernetes.services; import io.kestra.core.runners.RunContext; -import io.kestra.core.tasks.scripts.BashService; +import io.kestra.core.tasks.PluginUtilsService; import lombok.Getter; import org.slf4j.Logger; import org.slf4j.event.Level; @@ -12,7 +12,6 @@ import java.time.format.DateTimeParseException; import java.util.ArrayList; import java.util.Arrays; -import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -63,7 +62,7 @@ private void send() { line = String.join(" ", logs); } - outputs.putAll(BashService.parseOut(line, logger, runContext)); + outputs.putAll(PluginUtilsService.parseOut(line, logger, runContext)); switch (level) {