Skip to content

Commit c9b48aa

Browse files
authored
docs: add ADR for mergable preflight specs (#858)
Adds a proposed Architecture Decision Records for the ability to specify multiple specs per preflight test.
1 parent 511671f commit c9b48aa

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ADR 002: Mergeable preflight specs
2+
3+
When the `preflight` binary, or pacakge, is called, it supports only one spec definition at a time.
4+
5+
Recent changes in Troubleshoot allow the `support-bundle` binary to be called with multiple specs at a time. This allows cluster components to contribute independant Troubleshoot specs for their scope, and have Troubleshoot assemble them at run time.
6+
7+
Tools such as kURL have components which are maintained with a degree of separation to one another. It would be helpful to the maintainers of such projects to be able to call `preflight` specifying a number of specs at runtime, allowing Troubleshoot to assemble them into one spec for collection/analysis.
8+
9+
Currently if the `preflight` binary is called with multiple specs, it simply ignores all after the first.
10+
11+
## Decision
12+
13+
Modify the `preflight` CLI and package to be able to read multiple args rather than just one.
14+
15+
Introduce a merge mechanism in the same way that the `support-bundle` binary runs, to merge and deduplicate Preflight specs.
16+
17+
## Status
18+
19+
Proposed
20+
21+
## Consequences
22+
23+
There are no backward compatibility consequences or breaking changes in this proposal.
24+
25+
The project benefits:
26+
* Folks maintaining kURL add-ons can contribute unique preflight specs for their add-on (and the same for other projects simlarly structured)
27+
* Folks using `preflight` from the CLI without other applications (e.g. for a Helm install) are able to specify a list of preflights for their application rather than having to assemble one spec for each environment.
28+
29+
## Design notes
30+
31+
This proposal does not include adding the `uri:` field to `kind: Preflight`.
32+
33+
The file `cmd/preflight/cli/root.go` calls `preflight.RunPreflights` with `args[0]` which is likely to need to change to just `args`.
34+
35+
Func `RunPreflights` takes a single string arg (`arg string`) for the spec definition. This is likely to need to change to `arg []string`.
36+
37+
File `cmd/troubleshoot/cli/run.go` loops through the list of args, concatenating them together. A similar process is suitable for this change.

0 commit comments

Comments
 (0)