You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+73-2Lines changed: 73 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,23 @@ SDK to easy compile your hooks as a binary and integrate with addon operator
3
3
4
4
## Usage
5
5
6
+
### Module-SDK version compatibility with Deckhouse
7
+
| Module-SDK version | Deckhouse version|
8
+
| --- | --- |
9
+
| v0.2.X | < v1.71.0 |
10
+
| v0.3.X | >=v1.71.0 |
11
+
12
+
### Module-SDK features compatibility with Deckhouse
13
+
| Module-SDK version | Deckhouse version|
14
+
| --- | --- |
15
+
| Readiness Probe | >= v1.71.0 |
16
+
| Applications | Coming soon |
17
+
| Applications Settings check | Coming soon |
18
+
| Modules v2 | Coming soon |
19
+
| Modules v2 Settings check | Coming soon |
20
+
| Modules Settings check | Coming soon |
21
+
22
+
6
23
### One file example
7
24
This file must be in 'hooks/' folder to build binary (see examples for correct layout)
8
25
@@ -59,7 +76,16 @@ func main() {
59
76
}
60
77
```
61
78
62
-
More examples you can find [here](./examples)
79
+
More examples you can find [here](./examples).
80
+
81
+
### Reusable building blocks
82
+
83
+
| Area | What you get | Read more |
84
+
| --- | --- | --- |
85
+
| Common hooks | Battery-included hooks for TLS, custom certificates, storage-class changes, external auth, CRD installation. |[`common-hooks/`](./common-hooks)|
86
+
| Testing — unit tests |`InputBuilder`, `StaticSnapshots`, `RecordingPatchCollector`, `JQRunOn*` and friends. |[`testing/helpers/`](./testing/helpers)|
87
+
| Testing — functional tests | Deckhouse-style harness with a fake K8s cluster, snapshot generator, and patch replayer. |[`testing/framework/`](./testing/framework)|
88
+
| Testing — strategy | Picking the right test layer, project-wide conventions. |[`TESTING.md`](./TESTING.md)|
63
89
64
90
## Adding Readiness Probes
65
91
@@ -244,7 +270,52 @@ Settings validation allows you to validate module configuration values before th
244
270
245
271
## Testing
246
272
247
-
If you want to test your JQ filter, you can use JQ helper like in example [here](./pkg/jq/jq_test.go)
273
+
The SDK ships with a layered testing toolkit that lets you test hooks at three levels of fidelity:
274
+
275
+
-**Unit tests** — quick handler-level tests using [`testing/helpers`](./testing/helpers): `InputBuilder`, real values store, `RecordingPatchCollector`, JQ helpers.
276
+
-**Functional tests** — deckhouse-style end-to-end tests using [`testing/framework`](./testing/framework): a fake Kubernetes cluster, real snapshot generation, replayed patches.
277
+
-**Mocks** — minimock-generated mocks for every `pkg.*` interface ([`testing/mock`](./testing/mock)) when you need precise control over a single collaborator.
0 commit comments