Skip to content

Commit

Permalink
[stable/insights-agent]: Add error messages when required values are …
Browse files Browse the repository at this point in the history
…not set for awscosts (FairwindsOps#956)
  • Loading branch information
ivanfetch-wt committed Oct 11, 2022
1 parent 926d9e7 commit 35fb3f3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
14 changes: 12 additions & 2 deletions scripts/fleet-install-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,20 @@ case "$CHANGED" in
printf "\nServer is up. Running Fleet install for cluster %s\n" "$cluster_name"

helm dependency build ./stable/insights-agent
helm upgrade --install insights-agent ./stable/insights-agent -f ./stable/insights-agent/ci/fleet-install-test.yaml \
retry=0
while ! helm upgrade --install insights-agent ./stable/insights-agent -f ./stable/insights-agent/ci/fleet-install-test.yaml \
--namespace insights-agent \
--create-namespace \
--set insights.cluster="$cluster_name"
--set insights.cluster="$cluster_name"; do
random_number=$(shuf -i 15-60 -n1)
printf "Helm installation of Insights using the fleet install method failed, will retry in %d seconds...\n" "${random_number}";
sleep "${random_number}"
retry=$(( retry + 1 ))
if [ $retry -gt 1 ]; then
printf "Unable to install Insights using the fleet install method after %d attempts. Giving up on it.\n" "${retry}"
exit 1
fi
done

kubectl wait --for=condition=complete job/fleet-installer --timeout=120s --namespace insights-agent
kubectl wait --for=condition=complete job/polaris --timeout=120s --namespace insights-agent
Expand Down
2 changes: 2 additions & 0 deletions stable/insights-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Changelog
## 2.8.1
* Add error messages when required values are not set for awscosts

## 2.8.0
* Admission request support to ignore some services account
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.8.0
version: 2.8.1
appVersion: 9.2.1
icon: https://raw.githubusercontent.com/FairwindsOps/charts/master/stable/insights-agent/icon.png
maintainers:
Expand Down
14 changes: 7 additions & 7 deletions stable/insights-agent/templates/awscosts/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ spec:
key: AWS_SECRET_ACCESS_KEY
{{- end }}
- name: AWS_DEFAULT_REGION
value: {{ .Values.awscosts.region }}
value: {{ required "You must set awscosts.region, please see https://insights.docs.fairwinds.com/technical-details/reports/aws-costs/#agent-configuration" .Values.awscosts.region }}
{{ include "proxy-env-spec" . | indent 12 | trim }}
command: ["./aws-costs.sh"]
args:
- --database
- {{ .Values.awscosts.database }}
- {{ required "You must set awscosts.database, , please see https://insights.docs.fairwinds.com/technical-details/reports/aws-costs/#agent-configuration" .Values.awscosts.database }}
- --table
- {{ .Values.awscosts.table }}
- {{ required "You must set awscosts.table, please see https://insights.docs.fairwinds.com/technical-details/reports/aws-costs/#agent-configuration" .Values.awscosts.table }}
- --catalog
- {{ .Values.awscosts.catalog }}
- {{ required "You must set awscosts.catalog, please see https://insights.docs.fairwinds.com/technical-details/reports/aws-costs/#agent-configuration" .Values.awscosts.catalog }}
- --tagkey
- {{ .Values.awscosts.tagkey }}
- {{ required "You must set awscosts.tagkey, please see https://insights.docs.fairwinds.com/technical-details/reports/aws-costs/#agent-configuration" .Values.awscosts.tagkey }}
- --tagvalue
- {{ .Values.awscosts.tagvalue }}
- {{ required "You must set awscosts.tagvalue, please see https://insights.docs.fairwinds.com/technical-details/reports/aws-costs/#agent-configuration" .Values.awscosts.tagvalue }}
- --workgroup
- {{ .Values.awscosts.workgroup }}
- {{ required "You must set awscosts.workgroup, please see https://insights.docs.fairwinds.com/technical-details/reports/aws-costs/#agent-configuration" .Values.awscosts.workgroup }}
{{ include "security-context" . | indent 12 | trim }}
{{ include "uploaderContainer" . | indent 10 | trim }}
{{- end -}}

0 comments on commit 35fb3f3

Please sign in to comment.