Skip to content

Comments

fix: metrics cleanup for deleted SealedSecrets#1764

Merged
agarcia-oss merged 1 commit intobitnami-labs:mainfrom
jfreeland:fix/metrics
Aug 14, 2025
Merged

fix: metrics cleanup for deleted SealedSecrets#1764
agarcia-oss merged 1 commit intobitnami-labs:mainfrom
jfreeland:fix/metrics

Conversation

@jfreeland
Copy link
Contributor

Description of the change

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.

Tested via joeyfreeland/sealed-secrets-controller:latest on linux/amd64.

🤖 Generated with opencode and claude-sonnet-4.

Benefits

SealedSecrets that 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 SealedSecrets periodically to do the garbage collection by hand.

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]>
@jfreeland jfreeland changed the title Fix metrics cleanup for deleted SealedSecrets fix: metrics cleanup for deleted SealedSecrets Aug 12, 2025
Copy link
Member

@agarcia-oss agarcia-oss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a good improvement, thanks!

@agarcia-oss agarcia-oss merged commit 5794c95 into bitnami-labs:main Aug 14, 2025
40 of 43 checks passed
@jfreeland jfreeland deleted the fix/metrics branch August 14, 2025 17:04
@jfreeland
Copy link
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 ([#&#8203;1758](bitnami-labs/sealed-secrets#1758))
- Simplify VIB helm chart validation ([#&#8203;1771](bitnami-labs/sealed-secrets#1771))
- Fix: metrics cleanup for deleted SealedSecrets ([#&#8203;1764](bitnami-labs/sealed-secrets#1764))
- Fix keyrenewperiod template chart ([#&#8203;1756](bitnami-labs/sealed-secrets#1756))
- Fix namespace validation to prevent mismatch errors ([#&#8203;1754](bitnami-labs/sealed-secrets#1754))
- Bump VIB action version and updates the service URL ([#&#8203;1770](bitnami-labs/sealed-secrets#1770))
- Bump golang version to latest available one for 1.24 ([#&#8203;1769](bitnami-labs/sealed-secrets#1769))
- Bump golang.org/x/crypto from 0.40.0 to 0.41.0 ([#&#8203;1768](bitnami-labs/sealed-secrets#1768))
- Bump github.com/prometheus/client\_golang from 1.22.0 to 1.23.0 ([#&#8203;1767](bitnami-labs/sealed-secrets#1767))
- Bump k8s.io/api from 0.33.2 to 0.33.3 ([#&#8203;1766](bitnami-labs/sealed-secrets#1766))
- Bump github.com/spf13/pflag from 1.0.6 to 1.0.7 ([#&#8203;1765](bitnami-labs/sealed-secrets#1765))
- Bump k8s.io/client-go from 0.33.2 to 0.33.3 ([#&#8203;1761](bitnami-labs/sealed-secrets#1761))
- Bump github.com/onsi/gomega from 1.37.0 to 1.38.0 ([#&#8203;1760](bitnami-labs/sealed-secrets#1760))
- Bump k8s.io/code-generator from 0.33.2 to 0.33.3 ([#&#8203;1759](bitnami-labs/sealed-secrets#1759))
- Bump golang.org/x/crypto from 0.39.0 to 0.40.0 ([#&#8203;1755](bitnami-labs/sealed-secrets#1755))
- Bump k8s.io/code-generator from 0.33.1 to 0.33.2 ([#&#8203;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-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stop reporting metrics for removed sealedsecrets

2 participants