Skip to content

Commit

Permalink
[stable/anchor-engine] Fix broken update bash command (helm#22193)
Browse files Browse the repository at this point in the history
Fixes mistakes in update bash command which trigger
when the database connection uses SSL. One was
improper escaping of the ampersand leading to bash
misinterpreting the command. The other was incorrect
use of helm's whitespace chomping leading to the
upload argument being smushed onto the URL.

Signed-off-by: Stefan Hacker <mail@hacst.net>
  • Loading branch information
hacst authored May 4, 2020
1 parent 2a51962 commit c645249
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stable/anchore-engine/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: anchore-engine
version: 1.6.2
version: 1.6.3
appVersion: 0.7.1
description: Anchore container analysis and policy evaluation engine service
keywords:
Expand Down
2 changes: 1 addition & 1 deletion stable/anchore-engine/templates/engine_upgrade_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
{{- end }}
command: ["/bin/bash", "-c"]
{{- if .Values.anchoreGlobal.dbConfig.ssl }}
args: ["anchore-manager db --db-use-ssl --db-connect postgresql://${ANCHORE_DB_USER}:${ANCHORE_DB_PASSWORD}@${ANCHORE_DB_HOST}/${ANCHORE_DB_NAME}?sslmode={{- .Values.anchoreGlobal.dbConfig.sslMode -}}&sslrootcert=/home/anchore/certs/{{- .Values.anchoreGlobal.dbConfig.sslRootCertName -}} upgrade --dontask"]
args: ["anchore-manager db --db-use-ssl --db-connect postgresql://${ANCHORE_DB_USER}:${ANCHORE_DB_PASSWORD}@${ANCHORE_DB_HOST}/${ANCHORE_DB_NAME}?sslmode={{ .Values.anchoreGlobal.dbConfig.sslMode }}\\&sslrootcert=/home/anchore/certs/{{ .Values.anchoreGlobal.dbConfig.sslRootCertName }} upgrade --dontask"]
{{- else }}
args: ["anchore-manager db --db-connect postgresql://${ANCHORE_DB_USER}:${ANCHORE_DB_PASSWORD}@${ANCHORE_DB_HOST}/${ANCHORE_DB_NAME} upgrade --dontask"]
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
image: {{ .Values.anchoreEnterpriseGlobal.image }}
command: ["/bin/bash", "-c"]
{{- if .Values.anchoreGlobal.dbConfig.ssl }}
args: ["anchore-enterprise-manager db --db-use-ssl --db-connect postgresql://${ANCHORE_DB_USER}:${ANCHORE_DB_PASSWORD}@${ANCHORE_DB_HOST}/${ANCHORE_DB_NAME}?sslmode={{- .Values.anchoreGlobal.dbConfig.sslMode -}}&sslrootcert=/home/anchore/certs/{{- .Values.anchoreGlobal.dbConfig.sslRootCertName -}} upgrade --dontask"]
args: ["anchore-enterprise-manager db --db-use-ssl --db-connect postgresql://${ANCHORE_DB_USER}:${ANCHORE_DB_PASSWORD}@${ANCHORE_DB_HOST}/${ANCHORE_DB_NAME}?sslmode={{ .Values.anchoreGlobal.dbConfig.sslMode }}\\&sslrootcert=/home/anchore/certs/{{ .Values.anchoreGlobal.dbConfig.sslRootCertName }} upgrade --dontask"]
{{- else }}
args: ["anchore-enterprise-manager db --db-connect postgresql://${ANCHORE_DB_USER}:${ANCHORE_DB_PASSWORD}@${ANCHORE_DB_HOST}/${ANCHORE_DB_NAME} upgrade --dontask"]
{{- end }}
Expand Down

0 comments on commit c645249

Please sign in to comment.