kestra-io / kestra-io/plugin-docker
Required task inputs fail at runtime instead of validation (Build.dockerfile/tags, Stop.containerId)
- Dominant language
- Java
- Stars
- 4
- Forks
- 7
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 3
Description
### Describe the issue
## plugin-docker
### Build: `dockerfile` and `tags` can fail at runtime instead of validation
**Summary**
`Build` derives required inputs without null/empty validation, so bad input throws a raw exception at execution time rather than failing flow validation up front.
**Location** — `src/main/java/io/kestra/plugin/docker/cli/Build.java`
- `dockerfile` field (~L157) has no `@NotNull`, but `run()` calls `runContext.render(this.dockerfile)...orElseThrow()` (~L258).
- `tags` is `@NotNull` (guards null, not empty), and `run()` calls `tags.iterator().next()` (~L251) to derive the registry.
**Impact**
- Omitting `dockerfile` passes validation, then throws `NoSuchElementException`/`orElseThrow` at runtime.
- An empty `tags: []` passes `@NotNull`, then throws `NoSuchElementException`.
**Suggested fix**
Add `@NotNull` to `dockerfile` (or validate before use) and `@NotEmpty`/`@Size(min = 1)` to `tags`.
---
### Stop: `containerId` lacks `@NotNull` and is mis-grouped
**Summary**
`containerId` is the required primary input but is neither validated nor grouped as such.
**Location** — `src/main/java/io/kestra/plugin/docker/cli/Stop.java`
- `containerId` (~L59-64) is `@PluginProperty(group = "connection")` with no `@NotNull`.
- `run()` calls `...containerId...orElseThrow()` (~L88-94).
**Impact**
Omitting `containerId` throws a raw `NoSuchElementException` at runtime instead of failing validation; the property also renders under "connection" instead of "main" in the UI.
**Suggested fix**
Add `@NotNull` and move it to `group = "main"`.
### Environment
- Kestra Version: rc10
- Latest plugin version
Contributor guide
No contributing guide indexed for this repository
Research direction
Inspect src/main/java/io/kestra/plugin/docker/cli/Build.java around the dockerfile and tags fields and their use in run(), then inspect Stop.java around containerId and its run() method. Confirm that missing or empty required inputs fail validation and that containerId appears in the main group instead of connection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100