@@ -61,11 +61,11 @@ func TestBuildHelmArgs(t *testing.T) {
6161 Nested struct {
6262 Field1 string `json:"field1"`
6363 Field2 int `json:"field2"`
64- } `json:"nested"`
64+ } `json:"nested,omitempty "`
6565 NestedEmpty struct {
6666 Field1 string `json:"field1"`
6767 Field2 int `json:"field2"`
68- } `json:"nestedEmpty,omitzero "`
68+ } `json:"nestedEmpty,omitempty "`
6969 NestedZero struct {
7070 Field1 string `json:"field1"`
7171 Field2 int `json:"field2"`
@@ -225,6 +225,10 @@ func generateValues() Values {
225225 values .Global .ImageShortNames = false
226226 values .Global .Keys .Encryption = "encryption-key"
227227 values .Global .Keys .Token = "token-key"
228+ values .Global .Postgresql .Auth .ExistingSecret = "pg-secret"
229+ values .Global .Redis .Auth .ExistingSecret = "redis-secret"
230+ values .Global .Rabbitmq .Auth .ExistingSecret = "rabbitmq-secret"
231+ values .Global .Clickhouse .Auth .ExistingSecret = "ch-secret"
228232
229233 values .TLS .CertCA = "ca-cert-data"
230234 values .TLS .Cert = "cert-data"
@@ -275,9 +279,9 @@ func generateValues() Values {
275279 // CS Manager
276280 values .CSManager .RegistrationToken = "registration-token"
277281
278- // AuthAPI
279- values .AuthAPI .Administrator .Username = "user"
280- values .AuthAPI .Administrator .Password = "pass"
282+ // Administrator
283+ values .Global .Administrator .Username = "user"
284+ values .Global .Administrator .Password = "pass"
281285
282286 return values
283287}
@@ -311,15 +315,19 @@ func TestValuesToHelmArgs(t *testing.T) {
311315 "--set-string 'postgresql.auth.username=postgres'" ,
312316 "--set-string 'postgresql.auth.password=postgres-password'" ,
313317 "--set 'postgresql.persistence.enabled=true'" ,
318+ "--set-string 'global.postgresql.auth.existingSecret=pg-secret'" ,
314319 "--set 'global.postgresql.tls.enabled=true'" ,
315320 "--set 'global.postgresql.tls.verify=true'" ,
316321 "--set-string 'postgresql.persistence.storageClass=standard-1'" ,
317322 "--set 'redis.deploy=true'" ,
318323 "--set-string 'redis.auth.username=redis'" ,
319324 "--set-string 'redis.auth.password=redis-password'" ,
320325 "--set 'redis.persistence.enabled=false'" ,
326+ "--set-string 'global.redis.auth.existingSecret=redis-secret'" ,
321327 "--set 'global.redis.tls.enabled=false'" ,
322328 "--set 'global.redis.tls.verify=false'" ,
329+ "--set-string 'global.rabbitmq.auth.existingSecret=rabbitmq-secret'" ,
330+ "--set-string 'global.clickhouse.auth.existingSecret=ch-secret'" ,
323331 "--set 'metrics.enabled=false'" ,
324332 "--set 'rabbitmq.deploy=true'" ,
325333 "--set-string 'rabbitmq.auth.username=rabbitmq'" ,
@@ -341,8 +349,8 @@ func TestValuesToHelmArgs(t *testing.T) {
341349 "--set-string 'notifier.env[1].name=HTTPS_PROXY'" ,
342350 "--set-string 'notifier.env[1].value=https://proxy.local'" ,
343351 "--set-string 'cs-manager.registrationToken=registration-token'" ,
344- "--set-string 'auth-center .administrator.username=user'" ,
345- "--set-string 'auth-center .administrator.password=pass'" ,
352+ "--set-string 'global .administrator.username=user'" ,
353+ "--set-string 'global .administrator.password=pass'" ,
346354 }
347355
348356 if diff := cmp .Diff (args , expectedArgs ,
@@ -367,10 +375,6 @@ func TestValuesToYaml(t *testing.T) {
367375 lines := strings .Split (yaml , "\n " )
368376
369377 expectedLines := []string {
370- "auth-center:" ,
371- " administrator:" ,
372- " password: pass" ,
373- " username: user" ,
374378 "clickhouse:" ,
375379 " deploy: false" ,
376380 " externalHost: clickhouse.local" ,
@@ -379,8 +383,13 @@ func TestValuesToYaml(t *testing.T) {
379383 "cs-manager:" ,
380384 " registrationToken: registration-token" ,
381385 "global:" ,
386+ " administrator:" ,
387+ " password: pass" ,
388+ " username: user" ,
382389 " centralCsUrl: https://central-cs.local" ,
383390 " clickhouse:" ,
391+ " auth:" ,
392+ " existingSecret: ch-secret" ,
384393 " tls:" ,
385394 " enabled: false" ,
386395 " verify: false" ,
@@ -392,10 +401,17 @@ func TestValuesToYaml(t *testing.T) {
392401 " token: token-key" ,
393402 " ownCsUrl: https://cs.local" ,
394403 " postgresql:" ,
404+ " auth:" ,
405+ " existingSecret: pg-secret" ,
395406 " tls:" ,
396407 " enabled: true" ,
397408 " verify: true" ,
409+ " rabbitmq:" ,
410+ " auth:" ,
411+ " existingSecret: rabbitmq-secret" ,
398412 " redis:" ,
413+ " auth:" ,
414+ " existingSecret: redis-secret" ,
399415 " tls:" ,
400416 " enabled: false" ,
401417 " verify: false" ,
0 commit comments