Skip to content

Conversation

kasiakoziol
Copy link
Collaborator

@kasiakoziol kasiakoziol commented May 8, 2025

Description

This PR fixes a bug where a Smart Store secret created manually gets removed by the operator on Splunk resources removal because owner references are set by the Operator on the Splunk resources creation for given secret while it should not be managed by SOK.

Key Changes

Moving the DeleteOwnerReferencesForS3SecretObjects execution outside of DeleteOwnerReferencesForResources execution and outside of if cr.ObjectMeta.DeletionTimestamp != nil condition. Additionally, a small check needed to be added to the condition to make unit tests running since they rely on a namespaced secret, not a separate Smart Store secret.

Testing and Verification

Tested manually for S1, C3, M4, S1 & LM & MC, C3 & LM & MC and M4 & LM & MC. Automated tests executed as a part of the process.

Related Issues

https://splunk.atlassian.net/browse/CSPL-3704
#1474

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

@kasiakoziol kasiakoziol force-pushed the CSPL-3704_smartstore_secret_deletion branch from 5a0389d to eefc8bd Compare May 12, 2025 09:40
@kasiakoziol kasiakoziol force-pushed the CSPL-3704_smartstore_secret_deletion branch from eefc8bd to 044f581 Compare May 12, 2025 11:01
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 14970521101

Details

  • 28 of 28 (100.0%) changed or added relevant lines in 8 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.005%) to 86.618%

Files with Coverage Reduction New Missed Lines %
pkg/splunk/enterprise/util.go 1 90.58%
Totals Coverage Status
Change from base Build 14797754026: 0.005%
Covered Lines: 10557
Relevant Lines: 12188

💛 - Coveralls

@coveralls
Copy link
Collaborator

coveralls commented May 12, 2025

Pull Request Test Coverage Report for Build 14975880958

Details

  • 28 of 28 (100.0%) changed or added relevant lines in 8 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 86.626%

Files with Coverage Reduction New Missed Lines %
pkg/splunk/enterprise/util.go 1 90.58%
Totals Coverage Status
Change from base Build 14797754026: 0.01%
Covered Lines: 10558
Relevant Lines: 12188

💛 - Coveralls

@kasiakoziol kasiakoziol marked this pull request as ready for review May 12, 2025 12:05
@rlieberman-splunk
Copy link
Collaborator

Can you add the link to the GitHub issue this fixes to the description as well?

@kasiakoziol kasiakoziol changed the title CSPL-3704 Secret Management: SOK deletes automatically smartstore secrets created CSPL-3704 #1474 Secret Management: SOK deletes automatically smartstore secrets created May 13, 2025
Copy link
Collaborator

@patrykw-splunk patrykw-splunk left a comment

Choose a reason for hiding this comment

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

LGTM!

@kasiakoziol kasiakoziol merged commit 4f03ca8 into develop May 14, 2025
27 checks passed
@kasiakoziol kasiakoziol deleted the CSPL-3704_smartstore_secret_deletion branch May 14, 2025 08:39
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.

5 participants