From 1e67d35d1c9dedf0c175352ec3f8581d86a6d625 Mon Sep 17 00:00:00 2001 From: PaoloGallina Date: Tue, 10 Dec 2024 09:53:46 +0100 Subject: [PATCH] [super-agent] Secret garbage collection (#1540) #### Is this a new chart no #### What this PR does / why we need it: To garbage collect secrets after the disinstallation #### Special notes for your reviewer: #### Checklist [Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.] - [x] Chart Version bumped - [x] Variables are documented in the README.md - [x] Title of the PR starts with chart name (e.g. `[mychartname]`) --- charts/super-agent/Chart.lock | 6 +++--- charts/super-agent/Chart.yaml | 4 ++-- charts/super-agent/charts/super-agent-deployment/Chart.yaml | 2 +- .../super-agent-deployment/templates/uninstall-job.yaml | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/charts/super-agent/Chart.lock b/charts/super-agent/Chart.lock index 64a9c800f..382865af6 100644 --- a/charts/super-agent/Chart.lock +++ b/charts/super-agent/Chart.lock @@ -4,9 +4,9 @@ dependencies: version: 2.13.0 - name: super-agent-deployment repository: "" - version: 0.0.28-beta + version: 0.0.29-beta - name: common-library repository: https://helm-charts.newrelic.com version: 1.3.0 -digest: sha256:1f0d1be3ed6ab4f1cde3dd610f0743f217651cd93a87a2447d656452d0eaf853 -generated: "2024-12-02T16:47:50.023256+01:00" +digest: sha256:c827e90c8a5deac2f2795887c33a545109ea2a8755121cfc0818da87c3effa6e +generated: "2024-12-06T10:45:07.728045+01:00" diff --git a/charts/super-agent/Chart.yaml b/charts/super-agent/Chart.yaml index ee16bd295..3f9443b31 100644 --- a/charts/super-agent/Chart.yaml +++ b/charts/super-agent/Chart.yaml @@ -3,7 +3,7 @@ name: super-agent description: Bootstraps New Relic' Super Agent type: application -version: 0.0.26-beta +version: 0.0.27-beta dependencies: - name: flux2 @@ -11,7 +11,7 @@ dependencies: version: 2.13.0 condition: flux2.enabled - name: super-agent-deployment - version: 0.0.28-beta + version: 0.0.29-beta condition: super-agent-deployment.enabled # The following dependency is needed as sub-dependency of super-agent-deployment - name: common-library diff --git a/charts/super-agent/charts/super-agent-deployment/Chart.yaml b/charts/super-agent/charts/super-agent-deployment/Chart.yaml index df21d0e65..9871a9781 100644 --- a/charts/super-agent/charts/super-agent-deployment/Chart.yaml +++ b/charts/super-agent/charts/super-agent-deployment/Chart.yaml @@ -4,7 +4,7 @@ description: A Helm chart to install New Relic Super agent on Kubernetes type: application -version: 0.0.28-beta +version: 0.0.29-beta keywords: - newrelic diff --git a/charts/super-agent/charts/super-agent-deployment/templates/uninstall-job.yaml b/charts/super-agent/charts/super-agent-deployment/templates/uninstall-job.yaml index e63718c52..6890fc567 100644 --- a/charts/super-agent/charts/super-agent-deployment/templates/uninstall-job.yaml +++ b/charts/super-agent/charts/super-agent-deployment/templates/uninstall-job.yaml @@ -36,8 +36,9 @@ spec: # We want to avoid having the SA recreating some of the resources we are deleting running this job kubectl scale deployment --replicas=0 {{ include "newrelic.common.naming.fullname" . }} -n {{ $.Release.Namespace }} --timeout=60s - # Delete the standard resources (configmaps) managed by the super-agent + # Delete the standard resources (configmaps and secrets) managed by the super-agent kubectl delete configmaps -n {{ .Release.Namespace }} -l {{ $saResourcesLabelSelector }} + kubectl delete secrets -n {{ .Release.Namespace }} -l {{ $saResourcesLabelSelector }} # Delete the CRs managed by the super-agent if the corresponding CRDs exist {{ range $i, $cr := $saCRList }}