Skip to content

Commit d1a32ed

Browse files
AlinsRanCopilot
andcommitted
fix: scope postgres mirror to v2 CI
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4141447 commit d1a32ed

3 files changed

Lines changed: 22 additions & 7 deletions

File tree

.github/workflows/e2e-test-k8s.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,7 @@ jobs:
125125
TEST_LABEL: ${{ matrix.cases_subset }}
126126
INGRESS_VERSION: v1beta1
127127
TEST_ENV: CI
128+
POSTGRESQL_IMAGE_REGISTRY: docker.m.daocloud.io
129+
POSTGRESQL_IMAGE_REPOSITORY: bitnami/postgresql
128130
run: |
129131
make e2e-test

test/e2e/framework/api7_dashboard.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,24 @@ import (
3333
)
3434

3535
var (
36-
valuesTemplate *template.Template
37-
_db string
36+
valuesTemplate *template.Template
37+
_db string
38+
postgresImageRegistry string
39+
postgresImageRepository string
3840
)
3941

4042
func init() {
4143
_db = os.Getenv("DB")
4244
if _db == "" {
4345
_db = postgres
4446
}
47+
48+
postgresImageRegistry = os.Getenv("POSTGRESQL_IMAGE_REGISTRY")
49+
postgresImageRepository = os.Getenv("POSTGRESQL_IMAGE_REPOSITORY")
50+
if postgresImageRegistry != "" && postgresImageRepository == "" {
51+
postgresImageRepository = "bitnami/postgresql"
52+
}
53+
4554
tmpl, err := template.New("values.yaml").Parse(`
4655
dashboard:
4756
image:
@@ -209,9 +218,11 @@ postgresql:
209218
{{- if ne .DB "postgres" }}
210219
builtin: false
211220
{{- end }}
221+
{{- if .PostgresImageRegistry }}
212222
image:
213-
registry: docker.m.daocloud.io
214-
repository: bitnami/postgresql
223+
registry: {{ .PostgresImageRegistry }}
224+
repository: {{ .PostgresImageRepository }}
225+
{{- end }}
215226
primary:
216227
containerSecurityContext:
217228
enabled: false

test/e2e/framework/api7_framework.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ func (f *Framework) deploy() {
138138

139139
buf := bytes.NewBuffer(nil)
140140
_ = valuesTemplate.Execute(buf, map[string]any{
141-
"DB": _db,
142-
"DSN": getDSN(),
143-
"Tag": dashboardVersion,
141+
"DB": _db,
142+
"DSN": getDSN(),
143+
"Tag": dashboardVersion,
144+
"PostgresImageRegistry": postgresImageRegistry,
145+
"PostgresImageRepository": postgresImageRepository,
144146
})
145147

146148
f.Logf("values: %s", buf.String())

0 commit comments

Comments
 (0)