Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
fix daemonset generation if datadog.securityContext==nil (#23146)
Browse files Browse the repository at this point in the history
If the `datadog.securityContext` value is set to `nil` instead of `{}`
when a user want to remove the default `securityContext`, helm is not
able to generate the Daemonset manifest.

To support this configuration we have change how we test the value.
With the new `{{ if ...}}` check we don't check the second comparison
if the first already return false.

Signed-off-by: cedric lamoriniere <[email protected]>
  • Loading branch information
clamoriniere authored Jul 10, 2020
1 parent c556d78 commit 8884cab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions stable/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Datadog changelog

## 2.3.28

* fix daemonset template generation if `datadog.securityContext` is set to `nil`

## 2.3.27

* add systemProbe.collectDNSStats option
Expand Down
2 changes: 1 addition & 1 deletion stable/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 2.3.27
version: 2.3.28
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
6 changes: 6 additions & 0 deletions stable/datadog/ci/securitycontext-nil.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test the support of `securitContext` set to `nil`
datadog:
apiKey: "00000000000000000000000000000000"
appKey: "0000000000000000000000000000000000000000"

securityContext:
2 changes: 1 addition & 1 deletion stable/datadog/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
{{ toYaml .Values.agents.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- if and .Values.datadog.securityContext .Values.datadog.securityContext.seLinuxOptions }}
{{- if (.Values.datadog.securityContext) and .Values.datadog.securityContext.seLinuxOptions }}
securityContext:
seLinuxOptions:
{{ toYaml .Values.datadog.securityContext.seLinuxOptions | indent 10 }}
Expand Down

0 comments on commit 8884cab

Please sign in to comment.