Skip to content

Commit

Permalink
[datadog] trace-agent: chart must be backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
truthbk committed Jul 27, 2023
1 parent e72a0e1 commit 23921f7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions charts/datadog/templates/_container-trace-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,32 @@
- name: trace-agent
image: "{{ include "image-path" (dict "root" .Values "image" .Values.agents.image) }}"
imagePullPolicy: {{ .Values.agents.image.pullPolicy }}
{{- $version := .Values.agents.image.tag | toString | trimSuffix "-jmx" -}}
{{- $length := len (split "." $version) -}}
{{- if and (eq $length 1) (eq $version "6") -}}
{{- $version = "6.48.0" -}}
{{- end -}}
{{- if and (eq $length 1) (eq $version "7") -}}
{{- $version = "7.48.0" -}}
{{- end -}}
{{- if and (eq $length 1) (eq $version "latest") -}}
{{- $version = "7.48.0" -}}
{{- end -}}
{{- if semverCompare "^6.48.0-0 || ^7.48.0-0" $version -}}
{{- if eq .Values.targetSystem "linux" }}
command: ["trace-agent", "--config={{ template "datadog.confPath" . }}/datadog.yaml"]
{{- end -}}
{{- if eq .Values.targetSystem "windows" }}
command: ["trace-agent", "--foreground", "--config={{ template "datadog.confPath" . }}/datadog.yaml"]
{{- end -}}
{{- else -}}
{{- if eq .Values.targetSystem "linux" }}
command: ["trace-agent", "-config={{ template "datadog.confPath" . }}/datadog.yaml"]
{{- end -}}
{{- if eq .Values.targetSystem "windows" }}
command: ["trace-agent", "-foreground", "-config={{ template "datadog.confPath" . }}/datadog.yaml"]
{{- end -}}
{{- end -}}
{{ include "generate-security-context" (dict "securityContext" .Values.agents.containers.traceAgent.securityContext "targetSystem" .Values.targetSystem "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version) | indent 2 }}
resources:
{{ toYaml .Values.agents.containers.traceAgent.resources | indent 4 }}
Expand Down

0 comments on commit 23921f7

Please sign in to comment.