sonobuoy: Support storing results on host

Currently, results are stored using an emptyDir volume. This change adds
support for storing results using a customizable hostPath. When storing
results in a hostPath, results can still be obtained form the hostPath
while result publishing is disabled.

Change-Id: Ibd01da23a8e74a54f500429cf0ba8ca72f2ac77d
This commit is contained in:
Drew Walters 2019-06-19 14:38:05 +00:00
parent d0100055af
commit 32888e88fa
3 changed files with 15 additions and 2 deletions

View File

@ -32,3 +32,8 @@ openstack object create --name $prefixed_file_name {{ .Values.conf.swift.contain
openstack object show {{ .Values.conf.swift.container_name }} $prefixed_file_name
swift post {{ .Values.conf.swift.container_name }} $prefixed_file_name -H \"X-Delete-After:{{ .Values.conf.swift.delete_objects_after_seconds }}\"
# NOTE(aw442m): Delete results after publishing to avoid collisions when using host path
if [[ ! -z "${RESULTS_DIR}" ]]; then
rm "${RESULTS_DIR}"/"${file_name}"
fi

View File

@ -122,6 +122,12 @@ spec:
name: sonobuoy-plugins
defaultMode: 0444
name: sonobuoy-plugins-volume
- emptyDir: {}
name: sonobuoy-output
- name: sonobuoy-output
{{- if .Values.conf.host_results_path }}
hostPath:
path: {{ .Values.conf.host_results_path }}
type: DirectoryOrCreate
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}

View File

@ -107,6 +107,8 @@ manifests:
conf:
publish_results: true
# NOTE: use to store results on host; disabled by default.
host_results_path: null
# Injected values root used by (some of) the plugins. This `plugin_values`
# root is the parent for a mapping of named sections, each of which will be
# added as a file in the plugin-values secret.