Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=1.2.1-SNAPSHOT
kestraVersion=1.2.0
kestraVersion=1.2.1
5 changes: 3 additions & 2 deletions src/main/java/io/kestra/plugin/git/NamespaceSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.kestra.core.exceptions.KestraRuntimeException;
import io.kestra.core.models.annotations.Example;
import io.kestra.core.models.annotations.Plugin;
import io.kestra.core.models.flows.FlowSource;
import io.kestra.core.models.flows.FlowWithSource;
import io.kestra.core.models.property.Property;
import io.kestra.core.models.tasks.RunnableTask;
Expand Down Expand Up @@ -301,7 +302,7 @@ private void planFlows(RunContext rc, Path baseDir, GitTree gitTree, KestraState
diff.add(DiffLine.added(fileRel, key, Kind.FLOW));
if (!rDryRun) apply.add(() -> {
try {
var flowValidated = fs.validate(rc.flowInfo().tenantId(), gitNode.rawYaml).getFirst();
var flowValidated = fs.validate(rc.flowInfo().tenantId(), List.of(new FlowSource(key, gitNode.rawYaml))).getFirst();

if (flowValidated.getConstraints() != null) {
throw new FlowProcessingException(flowValidated.getConstraints());
Expand Down Expand Up @@ -360,7 +361,7 @@ private void planFlows(RunContext rc, Path baseDir, GitTree gitTree, KestraState
diff.add(DiffLine.updatedKestra(fileRel, key, Kind.FLOW));
if (!rDryRun) apply.add(() -> {
try {
var flowValidated = fs.validate(rc.flowInfo().tenantId(), gitNode.rawYaml).getFirst();
var flowValidated = fs.validate(rc.flowInfo().tenantId(), List.of(new FlowSource(key, gitNode.rawYaml))).getFirst();

if (flowValidated.getConstraints() != null) {
throw new FlowProcessingException(flowValidated.getConstraints());
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/io/kestra/plugin/git/SyncFlows.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
import io.kestra.core.models.annotations.Example;
import io.kestra.core.models.annotations.Plugin;
import io.kestra.core.models.flows.Flow;
import io.kestra.core.models.flows.FlowSource;
import io.kestra.core.models.flows.FlowWithException;
import io.kestra.core.models.flows.FlowWithSource;
import io.kestra.core.models.property.Property;
import io.kestra.core.runners.DefaultRunContext;
import io.kestra.core.runners.RunContext;
import io.kestra.core.services.FlowService;
import io.kestra.sdk.KestraClient;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.apache.commons.io.IOUtils;
import org.eclipse.jgit.api.Git;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -204,7 +203,7 @@ protected Flow simulateResourceWrite(RunContext runContext, String renderedNames

String flowSource = SyncFlows.replaceNamespace(renderedNamespace, uri, inputStream);

var flowValidated = flowService.validate(runContext.flowInfo().tenantId(), flowSource).getFirst();
var flowValidated = flowService.validate(runContext.flowInfo().tenantId(), List.of(new FlowSource(null, flowSource))).getFirst();

if (flowValidated.getConstraints() != null) {
var ref = uri.getPath();
Expand Down Expand Up @@ -245,7 +244,7 @@ protected Flow writeResource(RunContext runContext, String renderedNamespace, UR

String flowSource = SyncFlows.replaceNamespace(renderedNamespace, uri, inputStream);

var flowValidated = flowService.validate(runContext.flowInfo().tenantId(), flowSource).getFirst();
var flowValidated = flowService.validate(runContext.flowInfo().tenantId(), List.of(new FlowSource(null, flowSource))).getFirst();

if (flowValidated.getConstraints() != null) {
var ref = uri.getPath();
Expand Down
Loading