From 1ceba3f79bb0b5f3c18ecc9a34e0c62b12705416 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Mon, 25 Mar 2024 17:06:58 -0400 Subject: [PATCH] [stable/insights-agent] fix right-sizer oom-detection flag (#1450) * Update oom-detection-agent-cronjob.yaml * Update oom-detection-controller-deployment.yaml * Update oom-detection-controller-rbac.yaml * Update Chart.yaml * Update CHANGELOG.md --- stable/insights-agent/CHANGELOG.md | 2 ++ stable/insights-agent/Chart.yaml | 2 +- .../templates/right-sizer/oom-detection-agent-cronjob.yaml | 2 +- .../right-sizer/oom-detection-controller-deployment.yaml | 2 +- .../templates/right-sizer/oom-detection-controller-rbac.yaml | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/stable/insights-agent/CHANGELOG.md b/stable/insights-agent/CHANGELOG.md index 337a9f4ee..5fe1d2d4b 100644 --- a/stable/insights-agent/CHANGELOG.md +++ b/stable/insights-agent/CHANGELOG.md @@ -1,4 +1,6 @@ # Changelog +## 4.0.4 +* Fix guard against installing oom-detector unless right-sizer is enabled ## 4.0.3 * add `enableClosedBeta` flag to the `right-sizer` chart, also make it the condition for the VPA subchart diff --git a/stable/insights-agent/Chart.yaml b/stable/insights-agent/Chart.yaml index bdd009d87..8766b6cb4 100644 --- a/stable/insights-agent/Chart.yaml +++ b/stable/insights-agent/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: A Helm chart to run the Fairwinds Insights agent name: insights-agent -version: 4.0.3 +version: 4.0.4 appVersion: 9.2.1 kubeVersion: ">= 1.22.0-0" icon: https://raw.githubusercontent.com/FairwindsOps/charts/master/stable/insights-agent/icon.png diff --git a/stable/insights-agent/templates/right-sizer/oom-detection-agent-cronjob.yaml b/stable/insights-agent/templates/right-sizer/oom-detection-agent-cronjob.yaml index baa942a3a..e34500679 100644 --- a/stable/insights-agent/templates/right-sizer/oom-detection-agent-cronjob.yaml +++ b/stable/insights-agent/templates/right-sizer/oom-detection-agent-cronjob.yaml @@ -1,4 +1,4 @@ -{{- if (index .Values "right-sizer" "oom-detection" "enabled") -}} +{{- if (and (index .Values "right-sizer" "enabled") (index .Values "right-sizer" "oom-detection" "enabled")) -}} {{- $_ := set . "Label" "right-sizer" }} {{- $_ := set . "Config" (index .Values "right-sizer" "oom-detection") }} {{- include "cronjob" . }} diff --git a/stable/insights-agent/templates/right-sizer/oom-detection-controller-deployment.yaml b/stable/insights-agent/templates/right-sizer/oom-detection-controller-deployment.yaml index 834e69c3b..3176c1a71 100644 --- a/stable/insights-agent/templates/right-sizer/oom-detection-controller-deployment.yaml +++ b/stable/insights-agent/templates/right-sizer/oom-detection-controller-deployment.yaml @@ -1,4 +1,4 @@ -{{- if (index .Values "right-sizer" "oom-detection" "enabled") -}} +{{- if (and (index .Values "right-sizer" "enabled") (index .Values "right-sizer" "oom-detection" "enabled")) -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/stable/insights-agent/templates/right-sizer/oom-detection-controller-rbac.yaml b/stable/insights-agent/templates/right-sizer/oom-detection-controller-rbac.yaml index 551089eb8..1360aba19 100644 --- a/stable/insights-agent/templates/right-sizer/oom-detection-controller-rbac.yaml +++ b/stable/insights-agent/templates/right-sizer/oom-detection-controller-rbac.yaml @@ -1,4 +1,4 @@ -{{- if and (index .Values "right-sizer" "oom-detection" "enabled") (not .Values.rbac.disabled) -}} +{{- if and (and (index .Values "right-sizer" "enabled") (index .Values "right-sizer" "oom-detection" "enabled")) (not .Values.rbac.disabled) -}} apiVersion: v1 kind: ServiceAccount metadata: @@ -124,4 +124,4 @@ subjects: name: {{ include "insights-agent.fullname" . }}-right-sizer-oom-detection-controller namespace: {{ .Release.Namespace }} {{ end -}} -{{ end -}} \ No newline at end of file +{{ end -}}