Skip to content

Commit bc07edd

Browse files
committed
test(module): add test for discovery nodes hook
Signed-off-by: Pavel Tishkov <[email protected]>
1 parent f202a50 commit bc07edd

File tree

5 files changed

+23
-75
lines changed

5 files changed

+23
-75
lines changed

images/hooks/cmd/discovery-virthandler-nodes/main_test.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
/*
2-
Copyright 2024 Flant JSC
3-
Licensed under the Deckhouse Platform Enterprise Edition (EE) license. See https://github.com/deckhouse/deckhouse/blob/main/ee/LICENSE
2+
Copyright 2025 Flant JSC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
415
*/
516

617
package main

images/hooks/cmd/discovery-workload-nodes/main.go

Lines changed: 0 additions & 71 deletions
This file was deleted.

images/hooks/go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ require (
88
github.com/deckhouse/deckhouse/pkg/log v0.0.0-20250424095005-9ab587d01d7a
99
github.com/deckhouse/module-sdk v0.2.2
1010
github.com/deckhouse/virtualization/api v0.15.0
11+
github.com/onsi/ginkgo v1.16.4
1112
github.com/onsi/ginkgo/v2 v2.17.1
1213
github.com/onsi/gomega v1.32.0
1314
github.com/tidwall/gjson v1.14.4
1415
golang.org/x/crypto v0.38.0
1516
k8s.io/api v0.30.11
1617
k8s.io/apimachinery v0.30.11
1718
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
19+
sigs.k8s.io/yaml v1.4.0
1820
)
1921

2022
require (
@@ -50,6 +52,8 @@ require (
5052
github.com/google/uuid v1.6.0 // indirect
5153
github.com/imdario/mergo v0.3.16 // indirect
5254
github.com/inconshreveable/mousetrap v1.1.0 // indirect
55+
github.com/itchyny/gojq v0.12.17 // indirect
56+
github.com/itchyny/timefmt-go v0.1.6 // indirect
5357
github.com/jmoiron/sqlx v1.3.5 // indirect
5458
github.com/jonboulle/clockwork v0.4.0 // indirect
5559
github.com/josharian/intern v1.0.0 // indirect
@@ -60,6 +64,7 @@ require (
6064
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6165
github.com/modern-go/reflect2 v1.0.2 // indirect
6266
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
67+
github.com/nxadm/tail v1.4.8 // indirect
6368
github.com/opencontainers/go-digest v1.0.0 // indirect
6469
github.com/opencontainers/image-spec v1.1.0 // indirect
6570
github.com/openshift/api v0.0.0-20230503133300-8bbcb7ca7183 // indirect
@@ -94,6 +99,7 @@ require (
9499
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
95100
google.golang.org/protobuf v1.35.1 // indirect
96101
gopkg.in/inf.v0 v0.9.1 // indirect
102+
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
97103
gopkg.in/yaml.v2 v2.4.0 // indirect
98104
gopkg.in/yaml.v3 v3.0.1 // indirect
99105
k8s.io/apiextensions-apiserver v0.30.11 // indirect
@@ -106,7 +112,6 @@ require (
106112
sigs.k8s.io/controller-runtime v0.18.7 // indirect
107113
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
108114
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
109-
sigs.k8s.io/yaml v1.4.0 // indirect
110115
)
111116

112117
replace golang.org/x/net => golang.org/x/net v0.40.0 // CVE-2025-22870, CVE-2025-22872

images/hooks/go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,13 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
204204
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
205205
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
206206
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
207+
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
207208
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
208209
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
209210
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
210211
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
211212
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
213+
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
212214
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
213215
github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
214216
github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8=
@@ -468,6 +470,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV
468470
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
469471
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
470472
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
473+
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
471474
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
472475
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
473476
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

images/hooks/werf.inc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ shell:
3434
- go build -ldflags="-s -w" -o /hooks/prevent-default-vmclasses-deletion ./cmd/prevent-default-vmclasses-deletion
3535
- go build -ldflags="-s -w" -o /hooks/generate-secret-for-dvcr ./cmd/generate-secret-for-dvcr
3636
- go build -ldflags="-s -w" -o /hooks/discovery-clusterip-service-for-dvcr ./cmd/discovery-clusterip-service-for-dvcr
37-
- go build -ldflags="-s -w" -o /hooks/discovery-workload-nodes ./cmd/discovery-workload-nodes
37+
- go build -ldflags="-s -w" -o /hooks/discovery-virthandler-nodes ./cmd/discovery-virthandler-nodes

0 commit comments

Comments
 (0)