Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[artifactory] Create database secrets if postgres password is set #1110

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stable/artifactory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# JFrog Artifactory Chart Changelog
All changes to this chart will be documented in this file.

## [11.0.2] - Sep 16, 2020
* Create database secrets if password is set

## [11.0.1] - Sep 14, 2020
* Updated Artifactory version to 7.7.8 - [Release Notes](https://www.jfrog.com/confluence/display/JFROG/Artifactory+Release+Notes#ArtifactoryReleaseNotes-Artifactory7.7.8)

Expand Down
2 changes: 1 addition & 1 deletion stable/artifactory/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: artifactory
home: https://www.jfrog.com/artifactory/
version: 11.0.1
version: 11.0.2
appVersion: 7.7.8
description: Universal Repository Manager supporting all major packaging formats,
build tools and CI servers.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and (not .Values.database.secrets) (not .Values.postgresql.enabled) }}
{{- if or (and (not .Values.database.secrets) (not .Values.postgresql.enabled)) .Values.database.password }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@woodcockjosh I'm not sure this change is required , .Values.database.password implies external postgres

apiVersion: v1
kind: Secret
metadata:
Expand Down
3 changes: 3 additions & 0 deletions stable/artifactory/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ artifactory:
url: "jdbc:postgresql://{{ .Release.Name }}-postgresql:{{ .Values.postgresql.service.port }}/{{ .Values.postgresql.postgresqlDatabase }}"
driver: org.postgresql.Driver
username: "{{ .Values.postgresql.postgresqlUsername }}"
{{- if .Values.postgresql.postgresqlPassword }}
password: "{{ .Values.postgresql.postgresqlPassword }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@woodcockjosh This creates a secret for .Values.postgresql.postgresqlPassword from postgresql sub-chart and in statefulset it is referenced using JF_SHARED_DATABASE_PASSWORD

{{ if or .Values.database.secrets.password .Values.database.password .Values.postgresql.enabled }}
        - name: JF_SHARED_DATABASE_PASSWORD
          valueFrom:
            secretKeyRef:
        {{- if .Values.database.secrets.password }}
              name: {{ tpl .Values.database.secrets.password.name . }}
              key: {{ tpl .Values.database.secrets.password.key . }}
        {{- else if .Values.database.password }}
              name: {{ template "artifactory.fullname" . }}-database-creds
              key: db-password
        {{- else if .Values.postgresql.enabled }}
              name: {{ .Release.Name }}-postgresql
              key: postgresql-password
        {{- end }}
      {{- end }}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right well until a solution is implemented for #859 I'm going to use this approach to fix the problem with upgrades. It would be a shame if everyone else had to copy paste the artifactory chart to solve their problem but I understand if upgrading the chart without the upgrade failing is not the highest priority for the repo.

{{- end }}
{{- else }}
type: "{{ .Values.database.type }}"
driver: "{{ .Values.database.driver }}"
Expand Down