Skip to content

Commit e265107

Browse files
authored
Fix module names, switch to go hooks (#84)
Signed-off-by: v.oleynikov <[email protected]>
1 parent 91b1f5b commit e265107

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+823
-372
lines changed

.github/workflows/deploy_dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ jobs:
6767
with:
6868
module_source: "${{ vars.DEV_MODULE_SOURCE }}"
6969
module_name: ${{ vars.MODULE_NAME }}
70-
module_tag: $(echo pr${{ github.ref_name }} | sed 's/\/.*//g')
70+
module_tag: $(echo ${{ github.ref_name }} | sed 's/\/.*//g')
7171
- uses: deckhouse/modules-actions/deploy@v2

.github/workflows/deploy_prod.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ on:
3939
description: SE
4040
se-plus:
4141
type: boolean
42-
description: SE
42+
description: SE+
4343

4444
tag:
4545
description: "Tag of the module, example v1.21.1"
@@ -78,7 +78,7 @@ jobs:
7878
with:
7979
registry: ${{ vars.PROD_REGISTRY }}
8080
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
81-
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
81+
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
8282
- name: Check previous release
8383
run: |
8484
chmod +x .github/check_previous_channel_release.sh
@@ -107,7 +107,7 @@ jobs:
107107
with:
108108
registry: ${{ vars.PROD_REGISTRY }}
109109
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
110-
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
110+
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
111111
- name: Check previous release
112112
run: |
113113
chmod +x .github/check_previous_channel_release.sh
@@ -136,7 +136,7 @@ jobs:
136136
with:
137137
registry: ${{ vars.PROD_REGISTRY }}
138138
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
139-
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
139+
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
140140
- name: Check previous release
141141
run: |
142142
chmod +x .github/check_previous_channel_release.sh
@@ -165,7 +165,7 @@ jobs:
165165
with:
166166
registry: ${{ vars.PROD_REGISTRY }}
167167
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
168-
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
168+
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
169169
- name: Check previous release
170170
run: |
171171
chmod +x .github/check_previous_channel_release.sh
@@ -194,7 +194,7 @@ jobs:
194194
with:
195195
registry: ${{ vars.PROD_REGISTRY }}
196196
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
197-
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
197+
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
198198
- name: Check previous release
199199
run: |
200200
chmod +x .github/check_previous_channel_release.sh

.golangci.yaml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,24 @@ linters-settings:
1313
sections:
1414
- standard
1515
- default
16-
- prefix(d8-controller)
17-
- prefix(csi-nfs-scheduler-extender)
18-
- prefix(webhooks)
16+
- prefix(github.com/deckhouse)
1917

2018
linters:
2119
disable-all: true
2220
enable:
23-
- dogsled
24-
- errcheck
25-
- gci
26-
- gocritic
27-
- gofmt
28-
# - goimports
29-
- gosimple
30-
- govet
31-
- ineffassign
32-
- misspell
33-
- revive
34-
- staticcheck
35-
# - structcheck
36-
- typecheck
37-
- unconvert
38-
- unparam
39-
- whitespace
40-
- copyloopvar
21+
- dogsled
22+
- errcheck
23+
- gci
24+
- gocritic
25+
- gofmt
26+
- gosimple
27+
- govet
28+
- ineffassign
29+
- misspell
30+
- revive
31+
- staticcheck
32+
- typecheck
33+
- unconvert
34+
- unparam
35+
- whitespace
36+
- copyloopvar

.werf/bundle.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@ import:
1313
add: /lib/python/dist
1414
to: /lib/python/dist
1515
after: setup
16-
# Rendering .werf/choise-edition.yaml is required!
17-
- image: choise-edition
16+
# Rendering .werf/go-hooks.yaml is required!
17+
- image: go-hooks-artifact
18+
add: /usr/local/bin/go-hooks
19+
to: /hooks/go-hooks
20+
after: setup
21+
# Rendering .werf/choice-edition.yaml is required!
22+
- image: choice-edition
1823
add: /openapi
1924
to: /openapi
2025
after: setup
2126
git:
2227
- add: /
2328
to: /
29+
excludePaths:
30+
- hooks/go
2431
includePaths:
2532
- .helmignore
2633
- charts
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# TODO comment here
22
---
3-
image: choise-edition
3+
image: choice-edition
44
from: {{ $.BASE_ALT_P11 }}
5-
fromCacheVersion: 2025-02-10.1
5+
66
git:
77
- add: /
88
to: /
@@ -11,6 +11,5 @@ git:
1111
shell:
1212
setup:
1313
- cd /openapi
14-
# - cp -v values_{{ .MODULE_EDITION }}.yaml values.yaml
1514
- if [[ {{ .MODULE_EDITION }} == "ce" ]]; then cp -v values_ce.yaml values.yaml; else cp -v values_ee.yaml values.yaml; fi
1615
- rm -rf values_*.yaml

api/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/deckhouse/csi-nfs/api
22

3-
go 1.23.4
3+
go 1.23.6
44

55
require k8s.io/apimachinery v0.32.0
66

@@ -13,8 +13,8 @@ require (
1313
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
1414
github.com/modern-go/reflect2 v1.0.2 // indirect
1515
github.com/x448/float16 v0.8.4 // indirect
16-
golang.org/x/net v0.34.0 // indirect
17-
golang.org/x/text v0.21.0 // indirect
16+
golang.org/x/net v0.36.0 // indirect
17+
golang.org/x/text v0.22.0 // indirect
1818
gopkg.in/inf.v0 v0.9.1 // indirect
1919
k8s.io/klog/v2 v2.130.1 // indirect
2020
k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect

api/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
4545
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
4646
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
4747
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
48-
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
49-
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
48+
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
49+
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
5050
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
5151
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
5252
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -55,8 +55,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
5555
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5656
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
5757
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
58-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
59-
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
58+
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
59+
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
6060
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
6161
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
6262
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=

hooks/ensure_crds.py

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

hooks/generate_webhook_certs.py

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package hooks_common
2+
3+
import (
4+
"fmt"
5+
6+
consts "github.com/deckhouse/csi-nfs/hooks/go/consts"
7+
tlscertificate "github.com/deckhouse/module-sdk/common-hooks/tls-certificate"
8+
)
9+
10+
var _ = tlscertificate.RegisterInternalTLSHookEM(tlscertificate.GenSelfSignedTLSHookConf{
11+
CN: consts.WebhookCertCn,
12+
TLSSecretName: fmt.Sprintf("%s-webhook-cert", consts.WebhookCertCn),
13+
Namespace: consts.ModuleNamespace,
14+
SANs: tlscertificate.DefaultSANs([]string{
15+
consts.WebhookCertCn,
16+
fmt.Sprintf("%s.%s", consts.WebhookCertCn, consts.ModuleNamespace),
17+
fmt.Sprintf("%s.%s.svc", consts.WebhookCertCn, consts.ModuleNamespace),
18+
// %CLUSTER_DOMAIN%:// is a special value to generate SAN like 'svc_name.svc_namespace.svc.cluster.local'
19+
fmt.Sprintf("%%CLUSTER_DOMAIN%%://%s.%s.svc", consts.WebhookCertCn, consts.ModuleNamespace),
20+
}),
21+
FullValuesPathPrefix: fmt.Sprintf("%s.internal.customWebhookCert", consts.ModuleName),
22+
})

0 commit comments

Comments
 (0)