SBOM-Operator Environment Variable Config Fix (#112)

* fix(sbom-operator): uses correct indentation for environment variables set by helm values

Fixes: #111

* test(sbom-operator): adds basic test for arg and env configuration

Fixes: #111
This commit is contained in:
Markus Spöri 2022-07-19 17:11:37 +02:00 committed by GitHub
parent 5127b0bd0a
commit 8ca92b51a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 6 deletions

View File

@ -1,7 +1,7 @@
apiVersion: v2 apiVersion: v2
description: Catalogue all images of a Kubernetes cluster to multiple targets with Syft description: Catalogue all images of a Kubernetes cluster to multiple targets with Syft
name: sbom-operator name: sbom-operator
version: 0.13.0 version: 0.14.0
appVersion: 0.13.0 appVersion: 0.13.0
home: https://github.com/ckotzbauer/sbom-operator home: https://github.com/ckotzbauer/sbom-operator
sources: sources:

View File

@ -0,0 +1,9 @@
args:
format: json
verbosity: debug
cron: "@hourly"
targets: git
git-author-name: SBOM Operator
git-author-email: sbom-operator@example.com
git-repository: https://example.com/test-repo
git-access-token: letMeTest!

View File

@ -0,0 +1,17 @@
envVars:
- name: SBOM_FORMAT
value: json
- name: SBOM_VERBOSITY
value: debug
- name: SBOM_CRON
value: "@hourly"
- name: SBOM_TARGETS
value: git
- name: SBOM_GIT_AUTHOR_NAME
value: SBOM Operator
- name: SBOM_GIT_AUTHOR_EMAIL
value: sbom-operator@example.com
- name: SBOM_GIT_REPOSITORY
value: https://example.com/test-repo
- name: SBOM_GIT_ACCESS_TOKEN
value: letMeTest!

View File

@ -35,10 +35,10 @@ spec:
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: metadata.namespace fieldPath: metadata.namespace
{{- if .Values.envVars }} {{- if .Values.envVars }}
{{ toYaml .Values.envVars | nindent 12 }} {{ toYaml .Values.envVars | nindent 10 }}
{{- end }} {{- end }}
{{- if .Values.jobImageMode }} {{- if .Values.jobImageMode }}
- name: POD_NAME - name: POD_NAME
valueFrom: valueFrom:
fieldRef: fieldRef:
@ -47,7 +47,7 @@ spec:
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: metadata.uid fieldPath: metadata.uid
{{- end }} {{- end }}
securityContext: securityContext:
{{ toYaml .Values.securityContext | indent 12 }} {{ toYaml .Values.securityContext | indent 12 }}
resources: resources: