Skip to content

Commit 51100f7

Browse files
committed
Merge commit '74a8869026224e0782283ca69e755ca8a8971fdd' into feat/testing-framework
2 parents 6d15a28 + 74a8869 commit 51100f7

13 files changed

Lines changed: 600 additions & 11 deletions

File tree

examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
[Module hook examples with common hooks](https://github.com/deckhouse/module-sdk/tree/main/examples/common-hooks)
1212

1313
[Dockerfile and Makefile for building](https://github.com/deckhouse/module-sdk/tree/main/examples/scripts)
14+
15+
[Module hook example with settings checking](https://github.com/deckhouse/module-sdk/tree/main/examples/settings-check)

examples/settings-check/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Module Hooks Example
2+
In this example you can build your hook binary with settings checkiung and check how it works.
3+
4+
It can be usefull to understand how to do helm values validation.
5+
6+
### Run
7+
8+
To get list of your registered hooks
9+
```bash
10+
go run . hook list
11+
```
12+
13+
To get configs of your registered hooks
14+
```bash
15+
go run . hook config
16+
```
17+
18+
To run settings check
19+
```bash
20+
go run . hook check
21+
```
22+
23+
To dump configs of your registered hooks in file
24+
```bash
25+
go run . hook dump
26+
```
27+
28+
To run registered hook with index '0' (you can see index of your hook in output of "hook list" command)
29+
```bash
30+
go run . hook run 0
31+
```
32+
33+
By default, all logs in hooks are suppressed and he waiting for files in default folders.
34+
To make them available, you must add env variable LOG_LEVEL and CREATE_FILES.
35+
```bash
36+
CREATE_FILES=true LOG_LEVEL=INFO go run . hook run 0
37+
```
38+
39+
### Build
40+
```bash
41+
go build -o example-module-hooks .
42+
```
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
module valuescheck
2+
3+
go 1.24
4+
5+
require github.com/deckhouse/module-sdk v0.0.0
6+
7+
require (
8+
github.com/DataDog/gostackparse v0.7.0 // indirect
9+
github.com/beorn7/perks v1.0.1 // indirect
10+
github.com/caarlos0/env/v11 v11.3.1 // indirect
11+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
12+
github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
13+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
14+
github.com/deckhouse/deckhouse/pkg/log v0.0.0-20250814094423-e9f108b41a1a // indirect
15+
github.com/docker/cli v28.2.2+incompatible // indirect
16+
github.com/docker/distribution v2.8.3+incompatible // indirect
17+
github.com/docker/docker-credential-helpers v0.9.3 // indirect
18+
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
19+
github.com/ettle/strcase v0.2.0 // indirect
20+
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
21+
github.com/fsnotify/fsnotify v1.7.0 // indirect
22+
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
23+
github.com/go-logr/logr v1.4.3 // indirect
24+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
25+
github.com/go-openapi/jsonreference v0.20.2 // indirect
26+
github.com/go-openapi/swag v0.23.0 // indirect
27+
github.com/gogo/protobuf v1.3.2 // indirect
28+
github.com/gojuno/minimock/v3 v3.4.7 // indirect
29+
github.com/golang/protobuf v1.5.4 // indirect
30+
github.com/google/btree v1.1.3 // indirect
31+
github.com/google/gnostic-models v0.6.8 // indirect
32+
github.com/google/go-cmp v0.7.0 // indirect
33+
github.com/google/go-containerregistry v0.20.6 // indirect
34+
github.com/google/gofuzz v1.2.0 // indirect
35+
github.com/google/uuid v1.6.0 // indirect
36+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
37+
github.com/jonboulle/clockwork v0.4.0 // indirect
38+
github.com/josharian/intern v1.0.0 // indirect
39+
github.com/json-iterator/go v1.1.12 // indirect
40+
github.com/klauspost/compress v1.18.0 // indirect
41+
github.com/mailru/easyjson v0.7.7 // indirect
42+
github.com/mitchellh/go-homedir v1.1.0 // indirect
43+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
44+
github.com/modern-go/reflect2 v1.0.2 // indirect
45+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
46+
github.com/opencontainers/go-digest v1.0.0 // indirect
47+
github.com/opencontainers/image-spec v1.1.1 // indirect
48+
github.com/pkg/errors v0.9.1 // indirect
49+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
50+
github.com/prometheus/client_golang v1.20.5 // indirect
51+
github.com/prometheus/client_model v0.6.1 // indirect
52+
github.com/prometheus/common v0.55.0 // indirect
53+
github.com/prometheus/procfs v0.15.1 // indirect
54+
github.com/sergi/go-diff v1.3.1 // indirect
55+
github.com/sirupsen/logrus v1.9.3 // indirect
56+
github.com/spf13/cobra v1.9.1 // indirect
57+
github.com/spf13/pflag v1.0.6 // indirect
58+
github.com/sylabs/oci-tools v0.16.0 // indirect
59+
github.com/tidwall/gjson v1.18.0 // indirect
60+
github.com/tidwall/match v1.1.1 // indirect
61+
github.com/tidwall/pretty v1.2.0 // indirect
62+
github.com/vbatts/tar-split v0.12.1 // indirect
63+
github.com/x448/float16 v0.8.4 // indirect
64+
golang.org/x/net v0.36.0 // indirect
65+
golang.org/x/oauth2 v0.30.0 // indirect
66+
golang.org/x/sync v0.16.0 // indirect
67+
golang.org/x/sys v0.33.0 // indirect
68+
golang.org/x/term v0.29.0 // indirect
69+
golang.org/x/text v0.22.0 // indirect
70+
golang.org/x/time v0.8.0 // indirect
71+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
72+
google.golang.org/protobuf v1.36.3 // indirect
73+
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
74+
gopkg.in/inf.v0 v0.9.1 // indirect
75+
gopkg.in/yaml.v3 v3.0.1 // indirect
76+
gotest.tools/v3 v3.5.1 // indirect
77+
k8s.io/api v0.32.10 // indirect
78+
k8s.io/apiextensions-apiserver v0.32.10 // indirect
79+
k8s.io/apimachinery v0.32.10 // indirect
80+
k8s.io/client-go v0.32.10 // indirect
81+
k8s.io/klog/v2 v2.130.1 // indirect
82+
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
83+
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
84+
sigs.k8s.io/controller-runtime v0.20.4 // indirect
85+
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
86+
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
87+
sigs.k8s.io/yaml v1.4.0 // indirect
88+
)
89+
90+
replace github.com/deckhouse/deckhouse/dhctl => github.com/deckhouse/deckhouse/dhctl v0.0.0-20241122092255-d267ec38bcdd
91+
92+
replace github.com/deckhouse/module-sdk => ../../../

0 commit comments

Comments
 (0)