Skip to content

Commit 04dd3bd

Browse files
feat(iar): adding registryConfigJSON and fixing the pullSecret usage
- pullSecret property is not working : it was creating a secret based on the value and not doing a reference to it - adding the support of the registryConfigJSON to have a consistent way to deploy like other agents (simpler to use than the dockerAPIToken based on the tooling we have today) - bump Chart to v1.1.2
1 parent de2cd6f commit 04dd3bd

File tree

5 files changed

+35
-24
lines changed

5 files changed

+35
-24
lines changed

helm-charts/falcon-image-analyzer/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.1.1
18+
version: 1.1.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "1.1.1"
24+
appVersion: "1.1.2"

helm-charts/falcon-image-analyzer/templates/daemonset.yaml

+10-5
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@ spec:
2121
labels:
2222
{{- include "falcon-image-analyzer.labels" . | nindent 8 }}
2323
spec:
24-
{{- if .Values.crowdstrikeConfig.dockerAPIToken }}
25-
imagePullSecrets:
26-
- name: {{ include "falcon-image-analyzer.fullname" . }}-pull-secret
27-
{{- end }}
28-
{{- if .Values.image.pullSecret }}
24+
{{- if or (.Values.image.pullSecret) (.Values.image.registryConfigJSON) (.Values.crowdstrikeConfig.dockerAPIToken) }}
2925
imagePullSecrets:
26+
{{- if and (.Values.crowdstrikeConfig.dockerAPIToken) (.Values.image.registryConfigJSON) }}
27+
{{- fail "crowdstrikeConfig.dockerAPIToken and image.registryConfigJSON cannot be used together." }}
28+
{{- else -}}
29+
{{ if or (.Values.crowdstrikeConfig.dockerAPIToken) (.Values.image.registryConfigJSON) }}
3030
- name: {{ include "falcon-image-analyzer.fullname" . }}-pull-secret
31+
{{- end }}
32+
{{- end }}
33+
{{- if .Values.image.pullSecret }}
34+
- name: {{ .Values.image.pullSecret }}
35+
{{- end }}
3136
{{- end }}
3237
serviceAccountName: {{ .Values.serviceAccount.name | default ( include "falcon-image-analyzer.fullname" . ) }}
3338
securityContext:

helm-charts/falcon-image-analyzer/templates/deployment.yaml

+10-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ spec:
2222
labels:
2323
{{- include "falcon-image-analyzer.labels" . | nindent 8 }}
2424
spec:
25-
{{- if .Values.crowdstrikeConfig.dockerAPIToken }}
26-
imagePullSecrets:
27-
- name: {{ include "falcon-image-analyzer.fullname" . }}-pull-secret
28-
{{- end }}
29-
{{- if .Values.image.pullSecret }}
25+
{{- if or (.Values.image.pullSecret) (.Values.image.registryConfigJSON) (.Values.crowdstrikeConfig.dockerAPIToken) }}
3026
imagePullSecrets:
27+
{{- if and (.Values.crowdstrikeConfig.dockerAPIToken) (.Values.image.registryConfigJSON) }}
28+
{{- fail "crowdstrikeConfig.dockerAPIToken and image.registryConfigJSON cannot be used together." }}
29+
{{- else -}}
30+
{{ if or (.Values.crowdstrikeConfig.dockerAPIToken) (.Values.image.registryConfigJSON) }}
3131
- name: {{ include "falcon-image-analyzer.fullname" . }}-pull-secret
32+
{{- end }}
33+
{{- end }}
34+
{{- if .Values.image.pullSecret }}
35+
- name: {{ .Values.image.pullSecret }}
36+
{{- end }}
3237
{{- end }}
3338
serviceAccountName: {{ .Values.serviceAccount.name | default ( include "falcon-image-analyzer.fullname" . ) }}
3439
securityContext:
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.crowdstrikeConfig.dockerAPIToken -}}
1+
{{ if or (.Values.crowdstrikeConfig.dockerAPIToken) (.Values.image.registryConfigJSON) }}
22
apiVersion: v1
33
kind: Secret
44
metadata:
@@ -8,16 +8,10 @@ metadata:
88
{{- include "falcon-image-analyzer.labels" . | nindent 4 }}
99
type: kubernetes.io/dockerconfigjson
1010
data:
11+
{{- if .Values.crowdstrikeConfig.dockerAPIToken }}
1112
.dockerconfigjson: {{ template "falcon-image-analyzer.imagePullSecret" . }}
1213
{{- end }}
13-
{{ if .Values.image.pullSecret }}
14-
apiVersion: v1
15-
kind: Secret
16-
metadata:
17-
name: {{ include "falcon-image-analyzer.fullname" . }}-pull-secret
18-
labels:
19-
{{- include "falcon-image-analyzer.labels" . | nindent 4 }}
20-
type: kubernetes.io/dockerconfigjson
21-
data:
22-
.dockerconfigjson: {{ .Values.image.pullSecret }}
23-
{{- end}}
14+
{{- if .Values.image.registryConfigJSON }}
15+
.dockerconfigjson: {{ .Values.image.registryConfigJSON }}
16+
{{- end }}
17+
{{- end }}

helm-charts/falcon-image-analyzer/values.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ image:
3030
# config json with user and pass of your own
3131
# private repository
3232
pullSecret:
33+
registryConfigJSON:
34+
35+
# Value must be base64. This setting conflicts with image.pullSecret
36+
# The base64 encoded string of the docker config json for the pull secret can be
37+
# gotten through:
38+
# $ cat ~/.docker/config.json | base64 -
39+
registryConfigJSON:
3340

3441
envFrom:
3542
- configMapRef:

0 commit comments

Comments
 (0)