diff --git a/jflyte-utils/src/main/java/org/flyte/jflyte/utils/ExecutionConfig.java b/jflyte-utils/src/main/java/org/flyte/jflyte/utils/ExecutionConfig.java index aeacb9efc..6bf44d3e3 100644 --- a/jflyte-utils/src/main/java/org/flyte/jflyte/utils/ExecutionConfig.java +++ b/jflyte-utils/src/main/java/org/flyte/jflyte/utils/ExecutionConfig.java @@ -31,12 +31,18 @@ public abstract class ExecutionConfig { public abstract String version(); + public abstract String platformUrl(); + + public abstract boolean platformInsecure(); + public static ExecutionConfig load() { return ExecutionConfig.builder() .project(getenv("FLYTE_INTERNAL_PROJECT")) .domain(getenv("FLYTE_INTERNAL_DOMAIN")) .version(getenv("FLYTE_INTERNAL_VERSION")) .image(getenv("FLYTE_INTERNAL_IMAGE")) + .platformUrl(getenv("FLYTE_PLATFORM_URL")) + .platformInsecure(Boolean.parseBoolean(getenv("FLYTE_PLATFORM_INSECURE"))) .build(); } @@ -55,6 +61,10 @@ public abstract static class Builder { public abstract Builder image(String image); + public abstract Builder platformUrl(String platformUrl); + + public abstract Builder platformInsecure(boolean platformInsecure); + public abstract ExecutionConfig build(); } } diff --git a/jflyte/src/main/java/org/flyte/jflyte/ExecuteDynamicWorkflow.java b/jflyte/src/main/java/org/flyte/jflyte/ExecuteDynamicWorkflow.java index e7fb8d352..5e7fb7d7c 100644 --- a/jflyte/src/main/java/org/flyte/jflyte/ExecuteDynamicWorkflow.java +++ b/jflyte/src/main/java/org/flyte/jflyte/ExecuteDynamicWorkflow.java @@ -54,6 +54,7 @@ import org.flyte.jflyte.utils.Config; import org.flyte.jflyte.utils.ExecutionConfig; import org.flyte.jflyte.utils.FileSystemLoader; +import org.flyte.jflyte.utils.FlyteAdminClient; import org.flyte.jflyte.utils.IdentifierRewrite; import org.flyte.jflyte.utils.JFlyteCustom; import org.flyte.jflyte.utils.PackageLoader; @@ -206,6 +207,8 @@ static DynamicJobSpec rewrite( .domain(config.domain()) .project(config.project()) .version(config.version()) + .adminClient( + FlyteAdminClient.create(config.platformUrl(), config.platformInsecure(), null)) .build() .visitor();