Skip to content

Commit 82616c2

Browse files
authored
Merge branch 'main' into main
2 parents 86b6c10 + 8831017 commit 82616c2

File tree

8 files changed

+135
-100
lines changed

8 files changed

+135
-100
lines changed

.github/workflows/lint.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'Lint Charts'
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'charts/zitadel/templates/**'
7+
- 'charts/zitadel/values.yaml'
8+
- 'charts/zitadel/Chart.yaml'
9+
10+
jobs:
11+
12+
lint:
13+
14+
runs-on: 'ubuntu-20.04'
15+
16+
steps:
17+
- id: 'checkout'
18+
name: Check The Repo Out
19+
uses: 'actions/checkout@v3'
20+
with:
21+
fetch-depth: 0
22+
23+
- id: 'set-up-helm'
24+
name: Install Helm (The Chart Testing CLI Depends On It)
25+
uses: 'azure/setup-helm@v3.5'
26+
with:
27+
version: latest
28+
29+
- id: 'set-up-python'
30+
name: Install Python (The Chart Testing CLI Depends On It)
31+
uses: 'actions/setup-python@v3.1.4'
32+
with:
33+
python-version: 3.11.4
34+
35+
- id: 'set-up-chart-testing'
36+
name: Install Chart Testing CLI
37+
uses: 'helm/chart-testing-action@v2.6.1'
38+
with:
39+
version: 'v3.8.0'
40+
41+
- id: 'list-changed'
42+
name: Check If The Chart Has Changes (not only comments, for example)
43+
run: |
44+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
45+
if [[ -n "$changed" ]]; then
46+
echo "changed=true" >> $GITHUB_OUTPUT
47+
fi
48+
49+
- id: 'lint'
50+
name: Lint The Chart
51+
run: 'ct lint --target-branch ${{ github.event.repository.default_branch }}'
52+
if: steps.list-changed.outputs.changed == 'true'

.github/workflows/test.yml

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: 'Test Charts'
22

3-
on: 'pull_request'
3+
on:
4+
pull_request:
5+
paths:
6+
- 'charts/zitadel/**'
7+
- 'examples/**/*.yaml'
8+
- 'go.mod'
9+
- 'go.sum'
410

511
jobs:
612
test:
@@ -50,56 +56,13 @@ jobs:
5056
with:
5157
fetch-depth: 0
5258

53-
- id: 'set-up-helm'
54-
name: Install Helm (The Chart Testing CLI Depends On It)
55-
uses: 'azure/setup-helm@v3.5'
56-
with:
57-
version: '${{ matrix.helm-version }}'
58-
token: ${{ secrets.GITHUB_TOKEN }}
59-
60-
- id: 'set-up-python'
61-
name: Install Python (The Chart Testing CLI Depends On It)
62-
uses: 'actions/setup-python@v3.1.4'
63-
with:
64-
python-version: 3.11.4
65-
66-
- id: 'set-up-chart-testing'
67-
name: Install Chart Testing CLI
68-
uses: 'helm/chart-testing-action@v2.6.1'
69-
with:
70-
version: 'v3.8.0'
71-
72-
- id: 'list-changed'
73-
name: Check If The Chart Has Changes
74-
run: |
75-
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
76-
if [[ -n "$changed" ]]; then
77-
echo "changed=true" >> $GITHUB_OUTPUT
78-
fi
79-
80-
- name: Get Changed Test Relevant Files
81-
id: 'list-changed-test'
82-
uses: tj-actions/changed-files@v42
83-
with:
84-
files: |
85-
go.mod
86-
go.sum
87-
charts/zitadel/acceptance/**
88-
8959
- id: 'add-cockroachdb-repo'
9060
name: Add The CockroachDB Helm Repo
9161
run: 'helm repo add cockroachdb https://charts.cockroachdb.com/'
92-
if: steps.list-changed.outputs.changed == 'true' || steps.list-changed-test.outputs.any_changed == 'true'
93-
94-
- id: 'lint'
95-
name: Lint The Chart
96-
run: 'ct lint --target-branch ${{ github.event.repository.default_branch }}'
97-
if: steps.list-changed.outputs.changed == 'true' || steps.list-changed-test.outputs.any_changed == 'true'
9862

9963
- id: 'create-kind'
10064
name: Create Kubernetes Cluster with KinD
10165
uses: 'helm/kind-action@v1.8.0'
102-
if: steps.list-changed.outputs.changed == 'true' || steps.list-changed-test.outputs.any_changed == 'true'
10366
with:
10467
node_image: 'kindest/node:${{ matrix.k8s.kindest-image-tag }}'
10568
version: 'v0.20.0'
@@ -112,7 +75,6 @@ jobs:
11275
- id: 'test'
11376
name: Run Go Tests
11477
run: 'go test -p 1 ./...'
115-
if: steps.list-changed.outputs.changed == 'true' || steps.list-changed-test.outputs.any_changed == 'true'
11678

11779
- id: 'zitadel-test-namespaces'
11880
name: Grep Created Namespaces

charts/zitadel/acceptance/service_tunnel.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ func (c CloseFunc) Close() {
1616
// ServiceTunnel must be closed using the returned close function
1717
func ServiceTunnel(cfg *ConfigurationTest) func() {
1818
serviceTunnel := k8s.NewTunnel(cfg.KubeOptions, k8s.ResourceTypeService, cfg.zitadelRelease, int(cfg.Port), 8080)
19-
awaitServicePortToBeFree(cfg)
20-
serviceTunnel.ForwardPort(cfg.T())
19+
awaitServicePortForward(cfg, serviceTunnel)
2120
return serviceTunnel.Close
2221
}
2322

24-
func awaitServicePortToBeFree(cfg *ConfigurationTest) {
23+
func awaitServicePortForward(cfg *ConfigurationTest, tunnel *k8s.Tunnel) {
2524
t := cfg.T()
2625
addr, err := net.ResolveTCPAddr("tcp", fmt.Sprintf("127.0.0.1:%d", cfg.Port))
2726
if err != nil {
@@ -32,7 +31,9 @@ func awaitServicePortToBeFree(cfg *ConfigurationTest) {
3231
if err != nil {
3332
return err
3433
}
35-
defer l.Close()
36-
return nil
34+
if err := l.Close(); err != nil {
35+
panic(err)
36+
}
37+
return tunnel.ForwardPortE(cfg.T())
3738
})
3839
}

charts/zitadel/acceptance/teardown.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package acceptance
22

3-
import (
4-
"github.com/gruntwork-io/terratest/modules/k8s"
5-
)
3+
import "github.com/gruntwork-io/terratest/modules/k8s"
64

75
func (s *ConfigurationTest) TearDownTest() {
86
if !s.T().Failed() {

charts/zitadel/templates/deployment.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ spec:
7979
- name: ZITADEL_DATABASE_{{ $dbEnv }}_USER_SSL_KEY
8080
value: /.secrets/db-ssl-user-crt/tls.key
8181
{{- end }}
82+
{{- if .Values.zitadel.serverSslCrtSecret }}
83+
- name: ZITADEL_TLS_CERTPATH
84+
value: /.secrets/server-ssl-crt/tls.crt
85+
- name: ZITADEL_TLS_KEYPATH
86+
value: /.secrets/server-ssl-crt/tls.key
87+
{{- end }}
8288
{{- if .Values.zitadel.selfSignedCert.enabled }}
8389
- name: ZITADEL_TLS_CERTPATH
8490
value: /etc/tls/tls.crt
@@ -163,6 +169,7 @@ spec:
163169
(include "zitadel.makecpcommand" (dict "value" .Values.zitadel.configSecretName "path" "/zitadel-secret-config-yaml/" ))
164170
(include "zitadel.makecpcommand" (dict "value" (or .Values.zitadel.dbSslCaCrt .Values.zitadel.dbSslCaCrtSecret) "path" "/db-ssl-ca-crt/" ))
165171
(include "zitadel.makecpcommand" (dict "value" .Values.zitadel.dbSslUserCrtSecret "path" "/db-ssl-user-crt/" ))
172+
(include "zitadel.makecpcommand" (dict "value" .Values.zitadel.serverSslCrtSecret "path" "/server-ssl-crt/" ))
166173
)) }} chown -R 1000:1000 /chowned-secrets/ && find /chowned-secrets/ -type f -exec chmod 400 -- {} + "
167174
command:
168175
- sh
@@ -189,6 +196,10 @@ spec:
189196
- name: db-ssl-user-crt
190197
mountPath: /db-ssl-user-crt
191198
{{- end }}
199+
{{- if .Values.zitadel.serverSslCrtSecret }}
200+
- name: server-ssl-crt
201+
mountPath: /server-ssl-crt
202+
{{- end }}
192203
securityContext:
193204
runAsNonRoot: false
194205
runAsUser: 0
@@ -246,6 +257,11 @@ spec:
246257
secret:
247258
secretName: {{ .Values.zitadel.dbSslUserCrtSecret }}
248259
{{- end }}
260+
{{- if .Values.zitadel.serverSslCrtSecret }}
261+
- name: server-ssl-crt
262+
secret:
263+
secretName: {{ .Values.zitadel.serverSslCrtSecret }}
264+
{{- end }}
249265
- name: chowned-secrets
250266
emptyDir: {}
251267
{{- if .Values.zitadel.selfSignedCert.enabled }}

charts/zitadel/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ zitadel:
5353
# The db users secret containing the client certificate and key at tls.crt and tls.key needed for establishing secure database connections
5454
dbSslUserCrtSecret: ""
5555

56+
# The Secret containing the certificate at key tls.crt and tls.key for listening on HTTPS
57+
serverSslCrtSecret: ""
58+
5659
# Generate a self-signed certificate using an init container
5760
# This will also mount the generated files to /etc/tls/ so that you can reference them in the pod.
5861
# E.G. KeyPath: /etc/tls/tls.key CertPath: /etc/tls/tls.crt

go.mod

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
module github.com/zitadel/zitadel-charts
22

3-
go 1.21
3+
go 1.22.0
44

5-
toolchain go1.21.4
5+
toolchain go1.22.2
66

77
require (
8-
github.com/gruntwork-io/terratest v0.46.13
8+
github.com/gruntwork-io/terratest v0.46.14
99
github.com/jinzhu/copier v0.4.0
1010
github.com/stretchr/testify v1.9.0
1111
github.com/zitadel/oidc v1.13.5
12-
github.com/zitadel/zitadel-go/v2 v2.1.11
12+
github.com/zitadel/zitadel-go/v2 v2.2.1
1313
gopkg.in/yaml.v3 v3.0.1
14-
k8s.io/api v0.29.3
15-
k8s.io/apimachinery v0.29.3
16-
k8s.io/client-go v0.29.3
14+
k8s.io/api v0.30.0
15+
k8s.io/apimachinery v0.30.0
16+
k8s.io/client-go v0.30.0
1717
)
1818

1919
require (
@@ -26,7 +26,7 @@ require (
2626
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
2727
github.com/ghodss/yaml v1.0.0 // indirect
2828
github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 // indirect
29-
github.com/go-logr/logr v1.3.0 // indirect
29+
github.com/go-logr/logr v1.4.1 // indirect
3030
github.com/go-openapi/jsonpointer v0.19.6 // indirect
3131
github.com/go-openapi/jsonreference v0.20.2 // indirect
3232
github.com/go-openapi/swag v0.22.3 // indirect
@@ -44,6 +44,7 @@ require (
4444
github.com/google/uuid v1.6.0 // indirect
4545
github.com/gorilla/schema v1.2.0 // indirect
4646
github.com/gorilla/securecookie v1.1.1 // indirect
47+
github.com/gorilla/websocket v1.5.0 // indirect
4748
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
4849
github.com/gruntwork-io/go-commons v0.8.0 // indirect
4950
github.com/hashicorp/errwrap v1.0.0 // indirect
@@ -76,23 +77,23 @@ require (
7677
github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74 // indirect
7778
golang.org/x/crypto v0.21.0 // indirect
7879
golang.org/x/net v0.23.0 // indirect
79-
golang.org/x/oauth2 v0.18.0 // indirect
80+
golang.org/x/oauth2 v0.19.0 // indirect
8081
golang.org/x/sync v0.6.0 // indirect
8182
golang.org/x/sys v0.18.0 // indirect
8283
golang.org/x/term v0.18.0 // indirect
8384
golang.org/x/text v0.14.0 // indirect
8485
golang.org/x/time v0.3.0 // indirect
8586
google.golang.org/appengine v1.6.8 // indirect
86-
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
87-
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect
88-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect
89-
google.golang.org/grpc v1.62.1 // indirect
87+
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
88+
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
89+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
90+
google.golang.org/grpc v1.63.2 // indirect
9091
google.golang.org/protobuf v1.33.0 // indirect
9192
gopkg.in/inf.v0 v0.9.1 // indirect
9293
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
9394
gopkg.in/yaml.v2 v2.4.0 // indirect
94-
k8s.io/klog/v2 v2.110.1 // indirect
95-
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
95+
k8s.io/klog/v2 v2.120.1 // indirect
96+
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
9697
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
9798
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
9899
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect

0 commit comments

Comments
 (0)