fix: metrics cleanup for deleted SealedSecrets#1764
Merged
agarcia-oss merged 1 commit intobitnami-labs:mainfrom Aug 14, 2025
Merged
fix: metrics cleanup for deleted SealedSecrets#1764agarcia-oss merged 1 commit intobitnami-labs:mainfrom
agarcia-oss merged 1 commit intobitnami-labs:mainfrom
Conversation
UnregisterCondition was using the constant labelInstance instead of the actual label value from the SealedSecret, causing metrics to persist after deletion. This change ensures proper cleanup by using the actual instance label value, matching the behavior in ObserveCondition. 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <[email protected]> Signed-off-by: Joey Freeland <[email protected]>
agarcia-oss
approved these changes
Aug 14, 2025
Member
agarcia-oss
left a comment
There was a problem hiding this comment.
Seems to be a good improvement, thanks!
Contributor
Author
|
thank you @agarcia-oss. i see you updated the release notes yesterday but there was no release created. is there some testing first or will there be a release created soon? |
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Aug 21, 2025
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [bitnami-labs/sealed-secrets](https://github.com/bitnami-labs/sealed-secrets) | minor | `v0.30.0` -> `v0.31.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>bitnami-labs/sealed-secrets (bitnami-labs/sealed-secrets)</summary> ### [`v0.31.0`](https://github.com/bitnami-labs/sealed-secrets/blob/HEAD/RELEASE-NOTES.md#v0310) [Compare Source](bitnami-labs/sealed-secrets@v0.30.0...v0.31.0) - Helm: add watch for secrets ([#​1758](bitnami-labs/sealed-secrets#1758)) - Simplify VIB helm chart validation ([#​1771](bitnami-labs/sealed-secrets#1771)) - Fix: metrics cleanup for deleted SealedSecrets ([#​1764](bitnami-labs/sealed-secrets#1764)) - Fix keyrenewperiod template chart ([#​1756](bitnami-labs/sealed-secrets#1756)) - Fix namespace validation to prevent mismatch errors ([#​1754](bitnami-labs/sealed-secrets#1754)) - Bump VIB action version and updates the service URL ([#​1770](bitnami-labs/sealed-secrets#1770)) - Bump golang version to latest available one for 1.24 ([#​1769](bitnami-labs/sealed-secrets#1769)) - Bump golang.org/x/crypto from 0.40.0 to 0.41.0 ([#​1768](bitnami-labs/sealed-secrets#1768)) - Bump github.com/prometheus/client\_golang from 1.22.0 to 1.23.0 ([#​1767](bitnami-labs/sealed-secrets#1767)) - Bump k8s.io/api from 0.33.2 to 0.33.3 ([#​1766](bitnami-labs/sealed-secrets#1766)) - Bump github.com/spf13/pflag from 1.0.6 to 1.0.7 ([#​1765](bitnami-labs/sealed-secrets#1765)) - Bump k8s.io/client-go from 0.33.2 to 0.33.3 ([#​1761](bitnami-labs/sealed-secrets#1761)) - Bump github.com/onsi/gomega from 1.37.0 to 1.38.0 ([#​1760](bitnami-labs/sealed-secrets#1760)) - Bump k8s.io/code-generator from 0.33.2 to 0.33.3 ([#​1759](bitnami-labs/sealed-secrets#1759)) - Bump golang.org/x/crypto from 0.39.0 to 0.40.0 ([#​1755](bitnami-labs/sealed-secrets#1755)) - Bump k8s.io/code-generator from 0.33.1 to 0.33.2 ([#​1752](bitnami-labs/sealed-secrets#1752)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44MS41IiwidXBkYXRlZEluVmVyIjoiNDEuODEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
UnregisterConditionwas using the constantlabelInstanceinstead of the actual label value from theSealedSecret, causing metrics to persist after deletion. This change ensures proper cleanup by using the actual instance label value, matching the behavior inObserveCondition.Tested via
joeyfreeland/sealed-secrets-controller:latestonlinux/amd64.🤖 Generated with opencode and
claude-sonnet-4.Benefits
SealedSecretsthat are no longer present in the cluster will not have metrics reported.Possible drawbacks
TBD.
Applicable issues
Additional information
It'd be nice to have. I typically have to restart
SealedSecretsperiodically to do the garbage collection by hand.