Skip to content

Commit

Permalink
[stable/insights-agent] Added nested ifs to workaround bug on some he…
Browse files Browse the repository at this point in the history
…lm versions (#1382)

* Added nested ifs to workaround bug on some helm versions

* Fixed docs

* Code cleanup
  • Loading branch information
jdesouza authored Dec 1, 2023
1 parent f81f164 commit 5819f98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions stable/insights-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.25.3
* Cloud costs - added nested ifs to workaround a bug on some helm versions

## 2.25.2
* Cloud costs - google credentials bug fix

Expand Down
2 changes: 1 addition & 1 deletion stable/insights-agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart to run the Fairwinds Insights agent
name: insights-agent
version: 2.25.2
version: 2.25.3
appVersion: 9.2.1
kubeVersion: ">= 1.22.0-0"
icon: https://raw.githubusercontent.com/FairwindsOps/charts/master/stable/insights-agent/icon.png
Expand Down
10 changes: 7 additions & 3 deletions stable/insights-agent/templates/cloud-costs/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{{- if and .Values.cloudcosts .Values.cloudcosts.enabled -}}
{{ if and .Values.cloudcosts.aws .Values.cloudcosts.aws.accessKeyId }}
{{ if .Values.cloudcosts.aws }}
{{ if .Values.cloudcosts.aws.accessKeyId }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.cloudcosts.secretName }}
type: Opaque
data:
AWS_ACCESS_KEY_ID: {{ .Values.cloudcosts.aws.accessKeyId | b64enc}}
AWS_ACCESS_KEY_ID: {{ .Values.cloudcosts.aws.accessKeyId | b64enc }}
AWS_SECRET_ACCESS_KEY: {{ .Values.cloudcosts.aws.secretAccessKey | b64enc }}
{{ end }}
{{ if and .Values.cloudcosts.gcp .Values.cloudcosts.gcp.applicationCredentials }}
{{ end }}
{{ if .Values.cloudcosts.gcp }}
{{ if .Values.cloudcosts.gcp.applicationCredentials }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -19,4 +22,5 @@ data:
gcp-key.json: |
{{ .Values.cloudcosts.gcp.applicationCredentials | b64enc}}
{{ end }}
{{ end }}
{{- end -}}

0 comments on commit 5819f98

Please sign in to comment.