mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-28 02:18:36 +00:00
fix keycloak secrets drift (#508)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced management of Keycloak credentials by checking for existing passwords stored in Kubernetes Secrets. - Improved password management logic, allowing for the reuse of existing passwords or the generation of new ones as needed. - **Bug Fixes** - Streamlined secret handling to avoid unnecessary random password generation, improving security and maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Floppy Disk <kklinch0@gmail.com>
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
|
||||
{{- $host := index $cozyConfig.data "root-host" }}
|
||||
|
||||
{{- $existingPassword := lookup "v1" "Secret" "cozy-keycloak" "{{ .Release.Name }}-credentials" }}
|
||||
{{- $password := randAlphaNum 16 -}}
|
||||
{{- if $existingPassword }}
|
||||
{{- $password = index $existingPassword.data "password" | b64dec }}
|
||||
{{- end }}
|
||||
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
|
||||
Reference in New Issue
Block a user