# helm_charts_agentsecret.yaml
{{- if or .Values.agent.key .Values.agent.downloadKey }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "instana-agent.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "instana-agent.commonLabels" . | nindent 4 }}
type: Opaque
data:
{{- if .Values.templating }}
  key: {{ .Values.agent.key }}
{{- else }}
  key: {{ .Values.agent.key | b64enc | quote }}
{{- end }}
{{- if .Values.agent.downloadKey }}
  downloadKey: {{ .Values.agent.downloadKey | b64enc | quote }}
{{- end }}
{{- end }}