-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03430a0
commit 901fc53
Showing
24 changed files
with
220 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
cli/src/main/java/io/kestra/cli/commands/flows/FlowValidateCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.kestra.cli.commands.flows; | ||
|
||
import io.kestra.cli.AbstractValidateCommand; | ||
import io.kestra.core.models.flows.Flow; | ||
import io.kestra.core.models.validations.ModelValidator; | ||
import io.kestra.core.serializers.YamlFlowParser; | ||
import jakarta.inject.Inject; | ||
import picocli.CommandLine; | ||
|
||
@CommandLine.Command( | ||
name = "validate", | ||
description = "validate a flow" | ||
) | ||
public class FlowValidateCommand extends AbstractValidateCommand { | ||
@Inject | ||
private YamlFlowParser yamlFlowParser; | ||
|
||
@Inject | ||
private ModelValidator modelValidator; | ||
|
||
@Override | ||
public Integer call() throws Exception { | ||
return this.call( | ||
Flow.class, | ||
yamlFlowParser, | ||
modelValidator, | ||
(Object object) -> { | ||
Flow flow = (Flow) object; | ||
return flow.getNamespace() + " / " + flow.getId(); | ||
} | ||
); | ||
} | ||
} |
95 changes: 0 additions & 95 deletions
95
cli/src/main/java/io/kestra/cli/commands/flows/ValidateCommand.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
cli/src/main/java/io/kestra/cli/commands/templates/TemplateValidateCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.kestra.cli.commands.templates; | ||
|
||
import io.kestra.cli.AbstractValidateCommand; | ||
import io.kestra.core.models.templates.Template; | ||
import io.kestra.core.models.validations.ModelValidator; | ||
import io.kestra.core.serializers.YamlFlowParser; | ||
import jakarta.inject.Inject; | ||
import picocli.CommandLine; | ||
|
||
@CommandLine.Command( | ||
name = "validate", | ||
description = "validate a template" | ||
) | ||
public class TemplateValidateCommand extends AbstractValidateCommand { | ||
@Inject | ||
private YamlFlowParser yamlFlowParser; | ||
|
||
@Inject | ||
private ModelValidator modelValidator; | ||
|
||
@Override | ||
public Integer call() throws Exception { | ||
return this.call( | ||
Template.class, | ||
yamlFlowParser, | ||
modelValidator, | ||
(Object object) -> { | ||
Template template = (Template) object; | ||
return template.getNamespace() + " / " + template.getId(); | ||
} | ||
); | ||
} | ||
} |
Oops, something went wrong.