-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAbstractCloudQueryCommand.java
More file actions
74 lines (63 loc) · 2.37 KB
/
AbstractCloudQueryCommand.java
File metadata and controls
74 lines (63 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package io.kestra.plugin.cloudquery;
import java.util.Collections;
import java.util.Map;
import io.kestra.core.models.annotations.PluginProperty;
import io.kestra.core.models.property.Property;
import io.kestra.core.models.tasks.Task;
import io.kestra.core.models.tasks.runners.TaskRunner;
import io.kestra.plugin.scripts.exec.scripts.models.DockerOptions;
import io.kestra.plugin.scripts.runner.docker.Docker;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import lombok.*;
import lombok.experimental.SuperBuilder;
@SuperBuilder
@ToString
@EqualsAndHashCode
@Getter
@NoArgsConstructor
abstract class AbstractCloudQueryCommand extends Task {
protected static final String DEFAULT_IMAGE = "ghcr.io/cloudquery/cloudquery:latest";
@Schema(
title = "Set CloudQuery environment variables",
description = "Key-value pairs rendered by Kestra and passed to the CloudQuery process; empty by default."
)
@PluginProperty(group = "execution")
protected Property<Map<String, String>> env;
@Schema(
title = "Deprecated Docker runner options",
description = "Replaced by 'taskRunner'; keep only for legacy flows."
)
@PluginProperty(group = "execution")
@Deprecated
private DockerOptions docker;
@Schema(
title = "Choose the task runner",
description = """
Defaults to the Docker runner with an empty entrypoint. If you switch runners, ensure the entrypoint suits the CloudQuery binary."""
)
@PluginProperty(group = "execution")
@Builder.Default
@Valid
private TaskRunner<?> taskRunner = Docker.builder()
.type(Docker.class.getName())
.entryPoint(Collections.emptyList())
.build();
@Schema(
title = "Container image for CloudQuery runner",
description = "Used when the selected task runner is container-based; defaults to ghcr.io/cloudquery/cloudquery:latest."
)
@Builder.Default
@PluginProperty(group = "execution")
private Property<String> containerImage = Property.ofValue(DEFAULT_IMAGE);
protected DockerOptions injectDefaults(DockerOptions original) {
if (original == null) {
return null;
}
var builder = original.toBuilder();
if (original.getImage() == null) {
builder.image(DEFAULT_IMAGE);
}
return builder.build();
}
}