Skip to content

Commit d1118d5

Browse files
authored
[internal] Fixes in ci, webhooks certificates generation hooks and add dmt check (#86)
Signed-off-by: Vasily Oleynikov <[email protected]>
1 parent ba138ea commit d1118d5

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed

.github/workflows/build_dev.yml

+25-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,30 @@ defaults:
2525
shell: bash
2626

2727
jobs:
28+
lint:
29+
runs-on: [self-hosted, regular]
30+
continue-on-error: true
31+
name: Lint
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Copy openapi/values_ce.yaml to openapi/values.yaml
35+
run: |
36+
if [ -f openapi/values_ce.yaml ]; then
37+
cp openapi/values_ce.yaml openapi/values.yaml
38+
fi
39+
- uses: deckhouse/modules-actions/lint@main
40+
env:
41+
DMT_METRICS_URL: ${{ secrets.DMT_METRICS_URL }}
42+
DMT_METRICS_TOKEN: ${{ secrets.DMT_METRICS_TOKEN }}
43+
- name: Copy openapi/values_ee.yaml to openapi/values.yaml
44+
run: |
45+
if [ -f openapi/values_ee.yaml ]; then
46+
cp openapi/values_ee.yaml openapi/values.yaml
47+
fi
48+
- uses: deckhouse/modules-actions/lint@main
49+
env:
50+
DMT_METRICS_URL: ${{ secrets.DMT_METRICS_URL }}
51+
DMT_METRICS_TOKEN: ${{ secrets.DMT_METRICS_TOKEN }}
2852
set_edition:
2953
runs-on: [self-hosted, large]
3054
name: Set edition
@@ -94,4 +118,4 @@ jobs:
94118
with:
95119
module_source: "${{ vars.DEV_MODULE_SOURCE }}"
96120
module_name: ${{ vars.MODULE_NAME }}
97-
module_tag: $(echo pr${{ github.ref_name }} | sed 's/\/.*//g')
121+
module_tag: ${{ env.MODULES_MODULE_TAG }}

.github/workflows/deploy_dev.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ on:
3131
description: "The module's tag, which must include the -dev1 postfix. For example: v1.21.1-dev1"
3232
type: string
3333
required: true
34-
34+
3535
enableBuild:
3636
type: boolean
3737
default: true
38-
description: 'Set to true if build is required'
38+
description: "Set to true if build is required"
3939

4040
jobs:
4141
deploy-dev:
@@ -61,11 +61,11 @@ jobs:
6161
with:
6262
registry: ${{ vars.DEV_REGISTRY }}
6363
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
64-
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
64+
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
6565
- if: ${{ github.event.inputs.enableBuild == 'true' }}
6666
uses: deckhouse/modules-actions/build@v2
6767
with:
6868
module_source: "${{ vars.DEV_MODULE_SOURCE }}"
6969
module_name: ${{ vars.MODULE_NAME }}
70-
module_tag: $(echo ${{ github.ref_name }} | sed 's/\/.*//g')
70+
module_tag: ${{ github.event.inputs.tag }}
7171
- uses: deckhouse/modules-actions/deploy@v2

hooks/go/020-webhook-certs/webhook-certs.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ package hooks_common
33
import (
44
"fmt"
55

6-
consts "github.com/deckhouse/csi-nfs/hooks/go/consts"
76
tlscertificate "github.com/deckhouse/module-sdk/common-hooks/tls-certificate"
7+
consts "github.com/deckhouse/csi-nfs/hooks/go/consts"
88
)
99

1010
var _ = tlscertificate.RegisterInternalTLSHookEM(tlscertificate.GenSelfSignedTLSHookConf{
11-
CN: consts.WebhookCertCn,
12-
TLSSecretName: fmt.Sprintf("%s-webhook-cert", consts.WebhookCertCn),
13-
Namespace: consts.ModuleNamespace,
11+
CommonCACanonicalName: fmt.Sprintf("%s-%s", consts.ModulePluralName, consts.WebhookCertCn),
12+
CN: consts.WebhookCertCn,
13+
TLSSecretName: fmt.Sprintf("%s-https-certs", consts.WebhookCertCn),
14+
Namespace: consts.ModuleNamespace,
1415
SANs: tlscertificate.DefaultSANs([]string{
1516
consts.WebhookCertCn,
1617
fmt.Sprintf("%s.%s", consts.WebhookCertCn, consts.ModuleNamespace),

hooks/go/consts/consts.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package consts
22

33
const (
4-
ModuleName string = "csiNfs"
5-
ModuleNamespace string = "d8-csi-nfs"
6-
WebhookCertCn string = "webhooks"
4+
ModuleName string = "csiNfs"
5+
ModuleNamespace string = "d8-csi-nfs"
6+
ModulePluralName string = "csi-nfs"
7+
WebhookCertCn string = "webhooks"
78
)
89

910
var AllowedProvisioners = []string{

0 commit comments

Comments
 (0)