Skip to content

Commit

Permalink
Merge pull request #125 from mjnagel/handle-config-changes
Browse files Browse the repository at this point in the history
Add checksums for configs
  • Loading branch information
Btodhunter authored Mar 12, 2021
2 parents 65461bb + db2ed0b commit 4a9ddbb
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 80 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: v2
name: anchore-engine
version: 1.12.3
version: 1.12.4
appVersion: 0.9.2
description: Anchore container analysis and policy evaluation engine service
keywords:
Expand Down
6 changes: 6 additions & 0 deletions stable/anchore-engine/templates/analyzer_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ spec:
{{- with .Values.anchoreAnalyzer.annotations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if not .Values.inject_secrets_via_env }}
checksum/secrets: {{ include (print $.Template.BasePath "/engine_secret.yaml") . | sha256sum }}
{{- end }}
checksum/env: {{ include (print $.Template.BasePath "/engine_configmap_env.yaml") . | sha256sum }}
checksum/engine-config: {{ include (print $.Template.BasePath "/engine_configmap.yaml") . | sha256sum }}
checksum/analyzer-config: {{ include (print $.Template.BasePath "/analyzer_configmap.yaml") . | sha256sum }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
Expand Down
8 changes: 8 additions & 0 deletions stable/anchore-engine/templates/api_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ spec:
{{- with .Values.anchoreApi.annotations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if not .Values.inject_secrets_via_env }}
checksum/secrets: {{ include (print $.Template.BasePath "/engine_secret.yaml") . | sha256sum }}
{{- end }}
checksum/env: {{ include (print $.Template.BasePath "/engine_configmap_env.yaml") . | sha256sum }}
checksum/engine-config: {{ include (print $.Template.BasePath "/engine_configmap.yaml") . | sha256sum }}
{{- if .Values.anchoreGlobal.policyBundles }}
checksum/policy-config: {{ include (print $.Template.BasePath "/policy_bundle_configmap.yaml") . | sha256sum }}
{{- end }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
Expand Down
8 changes: 8 additions & 0 deletions stable/anchore-engine/templates/catalog_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ spec:
{{- with .Values.anchoreCatalog.annotations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if not .Values.inject_secrets_via_env }}
checksum/secrets: {{ include (print $.Template.BasePath "/engine_secret.yaml") . | sha256sum }}
{{- end }}
checksum/env: {{ include (print $.Template.BasePath "/engine_configmap_env.yaml") . | sha256sum }}
checksum/engine-config: {{ include (print $.Template.BasePath "/engine_configmap.yaml") . | sha256sum }}
{{- if .Values.anchoreGlobal.policyBundles }}
checksum/policy-config: {{ include (print $.Template.BasePath "/policy_bundle_configmap.yaml") . | sha256sum }}
{{- end }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
Expand Down
21 changes: 21 additions & 0 deletions stable/anchore-engine/templates/engine_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if not .Values.anchoreGlobal.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "anchore-engine.fullname" . }}
labels:
app: {{ template "anchore-engine.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.anchoreGlobal.labels }}
{{ toYaml . | nindent 4 }}
{{- end }}
type: Opaque
stringData:
ANCHORE_ADMIN_PASSWORD: {{ include "anchore-engine.defaultAdminPassword" . | quote }}
ANCHORE_DB_PASSWORD: {{ index .Values "postgresql" "postgresPassword" | quote }}
{{- with .Values.anchoreGlobal.saml.secret }}
ANCHORE_SAML_SECRET: {{ . }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ spec:
{{- with .Values.anchoreEnterpriseFeeds.annotations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if not .Values.inject_secrets_via_env }}
checksum/secrets: {{ include (print $.Template.BasePath "/enterprise_feeds_secret.yaml") . | sha256sum }}
{{- end }}
checksum/env: {{ include (print $.Template.BasePath "/enterprise_feeds_configmap_env.yaml") . | sha256sum }}
checksum/feeds-config: {{ include (print $.Template.BasePath "/enterprise_feeds_configmap.yaml") . | sha256sum }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
Expand Down
23 changes: 23 additions & 0 deletions stable/anchore-engine/templates/enterprise_feeds_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if not .Values.anchoreEnterpriseFeeds.existingSecret }}
{{- if and .Values.anchoreEnterpriseGlobal.enabled .Values.anchoreEnterpriseFeeds.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "anchore-engine.enterprise-feeds.fullname" . }}
labels:
app: {{ template "anchore-engine.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.anchoreGlobal.labels }}
{{ toYaml . | nindent 4 }}
{{- end }}
type: Opaque
stringData:
ANCHORE_ADMIN_PASSWORD: {{ include "anchore-engine.defaultAdminPassword" . | quote }}
ANCHORE_FEEDS_DB_PASSWORD: {{ index .Values "anchore-feeds-db" "postgresPassword" | quote }}
{{- with .Values.anchoreGlobal.saml.secret }}
ANCHORE_SAML_SECRET: {{ . }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions stable/anchore-engine/templates/enterprise_ui_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ spec:
{{- with .Values.anchoreEnterpriseUi.annotations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if not .Values.inject_secrets_via_env }}
checksum/secrets: {{ include (print $.Template.BasePath "/enterprise_ui_secret.yaml") . | sha256sum }}
{{- end }}
checksum/ui-config: {{ include (print $.Template.BasePath "/enterprise_ui_configmap.yaml") . | sha256sum }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
Expand Down
31 changes: 31 additions & 0 deletions stable/anchore-engine/templates/enterprise_ui_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- if not .Values.anchoreEnterpriseUi.existingSecret }}
{{- if and .Values.anchoreEnterpriseGlobal.enabled .Values.anchoreEnterpriseUi.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "anchore-engine.enterprise-ui.fullname" . }}
labels:
app: {{ template "anchore-engine.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.anchoreGlobal.labels }}
{{ toYaml . | nindent 4 }}
{{- end }}
type: Opaque
stringData:
ANCHORE_ADMIN_PASSWORD: {{ include "anchore-engine.defaultAdminPassword" . | quote }}

{{- if .Values.anchoreGlobal.dbConfig.ssl }}
ANCHORE_APPDB_URI: 'postgresql://{{ index .Values "postgresql" "postgresUser" }}:{{ index .Values "postgresql" "postgresPassword" }}@{{ template "db-hostname" . }}/{{ index .Values "postgresql" "postgresDatabase" }}?ssl=verify-full'
{{- else }}
ANCHORE_APPDB_URI: 'postgresql://{{ index .Values "postgresql" "postgresUser" }}:{{ index .Values "postgresql" "postgresPassword" }}@{{ template "db-hostname" . }}/{{ index .Values "postgresql" "postgresDatabase" }}'
{{- end }}

{{- if and (index .Values "anchore-ui-redis" "externalEndpoint") (not (index .Values "anchore-ui-redis" "enabled")) }}
ANCHORE_REDIS_URI: '{{ index .Values "anchore-ui-redis" "externalEndpoint" }}'
{{- else }}
ANCHORE_REDIS_URI: 'redis://:{{ index .Values "anchore-ui-redis" "password" }}@{{ template "redis.fullname" . }}-master:6379'
{{- end }}
{{- end }}
{{- end }}
5 changes: 5 additions & 0 deletions stable/anchore-engine/templates/policy_engine_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ spec:
{{- with .Values.anchorePolicyEngine.annotations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if not .Values.inject_secrets_via_env }}
checksum/secrets: {{ include (print $.Template.BasePath "/engine_secret.yaml") . | sha256sum }}
{{- end }}
checksum/env: {{ include (print $.Template.BasePath "/engine_configmap_env.yaml") . | sha256sum }}
checksum/engine-config: {{ include (print $.Template.BasePath "/engine_configmap.yaml") . | sha256sum }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
Expand Down
79 changes: 0 additions & 79 deletions stable/anchore-engine/templates/secrets.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions stable/anchore-engine/templates/simplequeue_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ spec:
{{- with .Values.anchoreSimpleQueue.annotations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if not .Values.inject_secrets_via_env }}
checksum/secrets: {{ include (print $.Template.BasePath "/engine_secret.yaml") . | sha256sum }}
{{- end }}
checksum/env: {{ include (print $.Template.BasePath "/engine_configmap_env.yaml") . | sha256sum }}
checksum/engine-config: {{ include (print $.Template.BasePath "/engine_configmap.yaml") . | sha256sum }}
spec:
{{- with .Values.anchoreGlobal.securityContext }}
securityContext:
Expand Down

0 comments on commit 4a9ddbb

Please sign in to comment.